summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-22 11:05:18 +0100
committerFabrice Bellard <fabrice@bellard.org>2023-12-22 11:05:18 +0100
commit7cefa7b121c8a800969672853b035278ebd6b24c (patch)
treef18cc86d8370779da36f72902237783137a4cfec /quickjs.c
parent43420235d50ce3f499d165af4a9368e79519f85b (diff)
downloadquickjs-7cefa7b121c8a800969672853b035278ebd6b24c.tar.gz
quickjs-7cefa7b121c8a800969672853b035278ebd6b24c.zip
'for of' expression cannot start with 'async'
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/quickjs.c b/quickjs.c
index a01b5cc..c80a300 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -25787,6 +25787,9 @@ static __exception int js_parse_for_in_of(JSParseState *s, int label_name,
emit_atom(s, var_name);
emit_u16(s, fd->scope_level);
}
+ } else if (!is_async && token_is_pseudo_keyword(s, JS_ATOM_async) &&
+ peek_token(s, FALSE) == TOK_OF) {
+ return js_parse_error(s, "'for of' expression cannot start with 'async'");
} else {
int skip_bits;
if ((s->token.val == '[' || s->token.val == '{')