From 673c6220cfca542bec0260a103d6ac01ee11c665 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Sat, 7 Nov 2026 12:45:55 +0100 Subject: [PATCH] fixed regexp skipping after template or private field (#596) --- quickjs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quickjs.c b/quickjs.c index d4ab4c3..0600dee 100644 --- a/quickjs.c +++ b/quickjs.c @@ -25403,9 +25403,11 @@ static BOOL is_regexp_allowed(int tok) case TOK_FALSE: case TOK_TRUE: case TOK_THIS: + case TOK_PRIVATE_NAME: case ')': case ']': case '}': /* XXX: regexp may occur after */ + case TOK_TEMPLATE: /* complete template literal; "${" is handled by the caller */ case TOK_IDENT: return FALSE; default: @@ -25485,6 +25487,7 @@ static int js_parse_skip_parens_token(JSParseState *s, int *pbits, BOOL no_line_ if (level >= sizeof(state)) goto done; state[level++] = '`'; + last_tok = '('; /* regexp allowed after it */ } break; case TOK_EOF: -- 2.47.3