Skip to content

Commit 7cefa7b

Browse files
author
Fabrice Bellard
committed
'for of' expression cannot start with 'async'
1 parent 4342023 commit 7cefa7b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

quickjs.c

+3
Original file line numberDiff line numberDiff line change
@@ -25787,6 +25787,9 @@ static __exception int js_parse_for_in_of(JSParseState *s, int label_name,
2578725787
emit_atom(s, var_name);
2578825788
emit_u16(s, fd->scope_level);
2578925789
}
25790+
} else if (!is_async && token_is_pseudo_keyword(s, JS_ATOM_async) &&
25791+
peek_token(s, FALSE) == TOK_OF) {
25792+
return js_parse_error(s, "'for of' expression cannot start with 'async'");
2579025793
} else {
2579125794
int skip_bits;
2579225795
if ((s->token.val == '[' || s->token.val == '{')

test262_errors.txt

-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ test262/test/language/expressions/dynamic-import/usage-from-eval.js:26: strict m
1818
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:21: TypeError: cannot read property 'c' of undefined
1919
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:15: strict mode: TypeError: cannot read property '_b' of undefined
2020
test262/test/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js:13: Test262Error: variable Expected a SyntaxError to be thrown but no exception was thrown at all
21-
test262/test/language/statements/for-of/head-lhs-async-invalid.js:14: unexpected error type: Test262: This statement should not be evaluated.
22-
test262/test/language/statements/for-of/head-lhs-async-invalid.js:14: strict mode: unexpected error type: Test262: This statement should not be evaluated.

0 commit comments

Comments
 (0)