From: Fabrice Bellard Date: Sat, 21 Nov 2026 15:56:06 +0000 (+0100) Subject: reject destructuring patterns without ':' after a property name X-Git-Url: https://git.kaiwu.me/http/%22../static/gitweb.js?a=commitdiff_plain;h=c9d81f5173cfea0e6bf1a962697756815ca70ccd;p=quickjs.git reject destructuring patterns without ':' after a property name --- diff --git a/quickjs.c b/quickjs.c index 9e90533..7d23daf 100644 --- a/quickjs.c +++ b/quickjs.c @@ -27123,7 +27123,7 @@ static int js_parse_destructuring_element(JSParseState *s, int tok, int is_arg, return -1; var_name = JS_ATOM_NULL; if (prop_type == PROP_TYPE_IDENT) { - if (next_token(s)) + if (js_parse_expect(s, ':')) goto prop_error; if ((s->token.val == '[' || s->token.val == '{') && ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||