Skip to content

Fix regex literal left brace parsing#35

Closed
davejcameron wants to merge 1 commit into
dy:mainfrom
davejcameron:dc.regex-literal-left-brace
Closed

Fix regex literal left brace parsing#35
davejcameron wants to merge 1 commit into
dy:mainfrom
davejcameron:dc.regex-literal-left-brace

Conversation

@davejcameron
Copy link
Copy Markdown
Contributor

Problem

Regex literals may contain a left brace that is not a repeat quantifier in non-unicode mode.

/a{/.test("a{")

That should evaluate to true, while valid repeat quantifiers such as /a{2}/ should continue to work.

Fix

Add focused regex feature coverage for preserving a literal left brace in regex source alongside a valid {2} quantifier. The regex parser keeps the pattern source for RegExp evaluation, so this guards against treating every { as a quantifier boundary.

Validation

  • node --import ./test/https-loader.js test/feature/regex.js
  • pnpm run build
  • pnpm test (fails on existing unicode scaling stack overflows and networked perf fetch checks)

@davejcameron davejcameron force-pushed the dc.regex-literal-left-brace branch from 6beb3d0 to a162198 Compare May 14, 2026 20:15
@davejcameron davejcameron deleted the dc.regex-literal-left-brace branch May 14, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant