We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293dfbd commit eca7a94Copy full SHA for eca7a94
graal-js/src/com.oracle.js.parser/src/com/oracle/js/parser/Parser.java
@@ -2957,6 +2957,13 @@ private void forStatement(boolean yield, boolean await) {
2957
if (!await) {
2958
throw error(AbstractParser.message(MSG_INVALID_FOR_AWAIT_OF), token);
2959
}
2960
+ if (isModule) {
2961
+ ParserContextFunctionNode currentFunction = lc.getCurrentFunction();
2962
+ if (currentFunction.isModule()) {
2963
+ // Top-level for-await: mark the module function as async.
2964
+ currentFunction.setFlag(FunctionNode.IS_ASYNC);
2965
+ }
2966
2967
isForAwaitOf = true;
2968
next();
2969
0 commit comments