Motivation
Surfaced during the #69 RegExp rollout (commit b968a9e). 12 generated tests under test/built-ins/RegExp/CharacterClassEscapes/ consistently fail at parse time. All have the same shape: they call a buildString(...) helper from regExpUtils.js (in the Test262 harness) with a configuration that enumerates the full Unicode code-point range.
Sample failing tests
test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-negative-cases.js
character-class-digit-class-escape-positive-cases.js
character-class-non-digit-class-escape-{negative,positive}-cases.js
character-class-non-whitespace-class-escape-{negative,positive}-cases.js
character-class-non-word-class-escape-{negative,positive}-cases.js
character-class-whitespace-class-escape-{negative,positive}-cases.js
character-class-word-class-escape-{negative,positive}-cases.js
The body shape:
const str = buildString({
loneCodePoints: [],
ranges: [
[0x00DC00, 0x00DFFF],
[0x000000, 0x00002F],
[0x00003A, 0x00DBFF],
[0x00E000, 0x10FFFF]
]
});
Impact
12 tests across both modes. Small bucket but worth tracking — these are the only ParseErrors in built-ins/RegExp and they form a coherent group.
Likely root causes (to investigate)
Possibilities, in rough order of likelihood:
includes: [regExpUtils.js] not loading correctly — the Test262 harness file isn't being assembled into the test program. Check Test262HarnessAssembler.cs.
- Object literal with array-of-2-element-arrays —
[[0x000000, 0x00002F], ...] could trip a parser ambiguity around [[ (array vs tagged template).
- Hex code-point range exceeding BMP —
0x10FFFF is outside BMP. Parser may handle code-point literals differently than codepoint values used as array elements.
- String size — the eventual
buildString(...) produces a string of ~1.1M characters. Some interpreter path may not handle strings that large; unlikely at parse time, but worth checking if the helper inlines the result.
Suggested approach
- Run one failing test directly:
dotnet run -- test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-negative-cases.js. Capture the actual parse-error diagnostic — it should localize the bug.
- Apply the targeted fix.
- Cross-check by running the other 11 tests (they'll likely all flip together).
Acceptance
- All 12
ParseError tests in RegExp/CharacterClassEscapes/ advance to Pass or to a more specific bucket.
- No regressions in the existing parser tests.
Related
Part of #69. Smallest but most narrowly-scoped of the surfaced clusters.
Motivation
Surfaced during the #69 RegExp rollout (commit b968a9e). 12 generated tests under
test/built-ins/RegExp/CharacterClassEscapes/consistently fail at parse time. All have the same shape: they call abuildString(...)helper fromregExpUtils.js(in the Test262 harness) with a configuration that enumerates the full Unicode code-point range.Sample failing tests
test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-negative-cases.jscharacter-class-digit-class-escape-positive-cases.jscharacter-class-non-digit-class-escape-{negative,positive}-cases.jscharacter-class-non-whitespace-class-escape-{negative,positive}-cases.jscharacter-class-non-word-class-escape-{negative,positive}-cases.jscharacter-class-whitespace-class-escape-{negative,positive}-cases.jscharacter-class-word-class-escape-{negative,positive}-cases.jsThe body shape:
Impact
12 tests across both modes. Small bucket but worth tracking — these are the only
ParseErrors inbuilt-ins/RegExpand they form a coherent group.Likely root causes (to investigate)
Possibilities, in rough order of likelihood:
includes: [regExpUtils.js]not loading correctly — the Test262 harness file isn't being assembled into the test program. CheckTest262HarnessAssembler.cs.[[0x000000, 0x00002F], ...]could trip a parser ambiguity around[[(array vs tagged template).0x10FFFFis outside BMP. Parser may handle code-point literals differently than codepoint values used as array elements.buildString(...)produces a string of ~1.1M characters. Some interpreter path may not handle strings that large; unlikely at parse time, but worth checking if the helper inlines the result.Suggested approach
dotnet run -- test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-negative-cases.js. Capture the actual parse-error diagnostic — it should localize the bug.Acceptance
ParseErrortests inRegExp/CharacterClassEscapes/advance toPassor to a more specific bucket.Related
Part of #69. Smallest but most narrowly-scoped of the surfaced clusters.