about summary refs log tree commit diff stats
path: root/lib/quickjs/quickjs.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-22 11:05:18 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-22 15:05:54 +0100
commit54cccc1f0bc389f3e406c68f9017c0223e7abf7f (patch)
treefb6c5422c9280f7d2a6639483ae9321fcfaa1ab0 /lib/quickjs/quickjs.c
parentcc7163ecd4b99b149fa16a2c41155493aec26448 (diff)
downloadchawan-54cccc1f0bc389f3e406c68f9017c0223e7abf7f.tar.gz
'for of' expression cannot start with 'async'
Diffstat (limited to 'lib/quickjs/quickjs.c')
-rw-r--r--lib/quickjs/quickjs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c
index 2bddb9e4..a10a5913 100644
--- a/lib/quickjs/quickjs.c
+++ b/lib/quickjs/quickjs.c
@@ -25922,6 +25922,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 == '{')