Something went wrong. Try again.
we (web engine): Experimental web browser project to understand the limits of Claude
Something went wrong. Try again.
js: lex `/` after control-flow header `)` as regex literal (isu issue 361) master
The lexer's regex-vs-division heuristic treated any `/` following a `)` as division, but `)` closing an `if`/`for`/`while`/`with` header is followed by statement/expression-start position, where `/` begins a RegularExpressionLiteral. This rejected valid Next.js chunks like `for(let t of x)/didomi/gi.test(t)`. Track per-`(` whether it opens a control-flow header (guarding against property-name keywords such as `obj.for(...)`), and on the matching `)` mark it as not ending an expression so the following `/` lexes as a regex. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author Pierre Le Fevre Co-author Claude Opus 4.8 Date (Jun 5, 2026, 12:45 AM UTC) Commit 898f3eac 898f3eac5b4ed3d60a476cfd5ec0d0e832861278 Parent 95c13f23 95c13f23a8446074f9cb80a3ca18fc688e3f7c24