]> git.kaiwu.me - quickjs.git/commitdiff
fixed parsing
authorFabrice Bellard <fabrice@bellard.org>
Sat, 21 Nov 2026 11:38:21 +0000 (12:38 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 21 Nov 2026 11:38:21 +0000 (12:38 +0100)
quickjs.c

index 0baef2aabd36e1eba8acfb68fd3be48d43c8c3b7..03d866be01fa4e444549b60b408d4ec0d419472d 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -28423,9 +28423,7 @@ static __exception int js_parse_expr_binary(JSParseState *s, int level,
         atom = JS_DupAtom(s->ctx, s->token.u.ident.atom);
         if (next_token(s))
             goto fail_private_in;
-        if (s->token.val != TOK_IN)
-            goto fail_private_in;
-        if (next_token(s))
+        if (js_parse_expect(s, TOK_IN))
             goto fail_private_in;
         if (js_parse_expr_binary(s, level - 1, parse_flags)) {
         fail_private_in: