Repository navigation
Conversation
trackoor
force-pushed
the
template-division
branch
from
November 6, 2026 07:58
689f565 to
0a11f80
Compare
|
3 new or modified tests were run on 7 engines.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a NoSubstitutionTemplate or a TemplateTail,
/is a division operator (InputElementDiv goal). I couldn't find a test where a template literal is followed by/.Engines that got this wrong:
/after a template literal is lexed as the start of a regular expression meta/hermes#2294 (fixed):`4` / 2is "non-terminated regular expression literal"/after a template literal inside parentheses is scanned as a regexp:(a =8/ 2) => ais a SyntaxError quickjs-ng/quickjs#1886 (fix in Fix '/' after a template literal in the arrow function lookahead quickjs-ng/quickjs#1887) and QuickJS:(a =8/ 2) => aand(a = this.#x / 2) => aare SyntaxErrors: the arrow lookahead scans/as a regexp bellard/quickjs#596: the arrow-function lookahead scans the/as a regexp, so(a = `8` / 2) => ais a SyntaxErrorThe tests also check the other direction: after a TemplateHead or TemplateMiddle,
/starts a regular expression, including inside arrow parameters ((a = `${/[)]/.source}`) => a).All three files pass (sloppy and strict) on V8 15.9.109, SpiderMonkey 160.0b5, JavaScriptCore (macOS 26.3), engine262 67a6b615, GraalJS 25.5.5, XS 17.9.3 and Boa nightly. Hermes 0.11.0 (the last CLI release, before the fix) fails all three; quickjs-ng e22ce4d and QuickJS 712e8c0 fail
arrow-function/dflt-params-template-literal-division.js.