Motivation
Follow-up to #101, which hardened the RegExp.prototype[Symbol.*] protocol to ECMA-262 §22.2.5 across both modes. That issue is now effectively complete — the Symbol.* surface passes 204/207 interpreted and 201/207 compiled (the remaining 9-per-mode skips are the separate regexp-named-groups feature).
This issue carves out the 7 distinct spec-edge test files that still fail, so the remaining work has an explicit, closeable target.
Remaining failing tests
Interpreted (3):
test/built-ins/RegExp/prototype/Symbol.replace/coerce-global.js — RuntimeError
test/built-ins/RegExp/prototype/Symbol.replace/fn-invoke-this-no-strict.js
test/built-ins/RegExp/prototype/Symbol.split/splitter-proto-from-ctor-realm.js — RuntimeError
Compiled (6, two shared with interpreter):
test/built-ins/RegExp/prototype/Symbol.match/builtin-infer-unicode.js
test/built-ins/RegExp/prototype/Symbol.match/builtin-success-u-return-val-groups.js
test/built-ins/RegExp/prototype/Symbol.search/u-lastindex-advance.js
test/built-ins/RegExp/prototype/Symbol.split/u-lastindex-adv-thru-match.js
test/built-ins/RegExp/prototype/Symbol.replace/fn-invoke-this-no-strict.js (also fails interpreted)
test/built-ins/RegExp/prototype/Symbol.split/splitter-proto-from-ctor-realm.js — RuntimeError (also fails interpreted)
Work clusters
1. Unicode-flag lastIndex advancement (4 compiled tests) — highest leverage
Symbol.match/builtin-infer-unicode.js
Symbol.match/builtin-success-u-return-val-groups.js
Symbol.search/u-lastindex-advance.js
Symbol.split/u-lastindex-adv-thru-match.js
The compiled exec loop needs surrogate-pair-aware index stepping when the u flag is set (§22.2.7.3 AdvanceStringIndex). The interpreter already passes these, so the C# reference exists — this is an IL port of the unicode advance step.
2. Replacer-fn this in non-strict mode (1 test, both modes)
Symbol.replace/fn-invoke-this-no-strict.js
The replacer function passed to Symbol.replace must be invoked with undefined this, which in non-strict mode coerces to the global object. Both modes currently mishandle the this binding.
3. Cross-realm prototype provenance (1 test, both modes)
Symbol.split/splitter-proto-from-ctor-realm.js
The species-constructed splitter must take its prototype from the constructor's realm. This likely needs realm support SharpTS does not model; may be out of scope — acceptable to mark Skipped with a feature tag if realms aren't planned.
Also (interpreted-only)
Symbol.replace/coerce-global.js — RuntimeError; likely related to cluster 1's global/unicode flag handling on the interpreter side.
Acceptance
- Clusters 1 and 2 flip to Pass in both modes (6 of 7 files).
- Cluster 3 either passes or is explicitly skipped with a realm-feature tag and a note.
- No regressions in
RegExp/prototype/* or String/prototype/* baselines.
Related
Follow-up to #101. Part of #69.
Motivation
Follow-up to #101, which hardened the
RegExp.prototype[Symbol.*]protocol to ECMA-262 §22.2.5 across both modes. That issue is now effectively complete — the Symbol.* surface passes 204/207 interpreted and 201/207 compiled (the remaining 9-per-mode skips are the separateregexp-named-groupsfeature).This issue carves out the 7 distinct spec-edge test files that still fail, so the remaining work has an explicit, closeable target.
Remaining failing tests
Interpreted (3):
test/built-ins/RegExp/prototype/Symbol.replace/coerce-global.js— RuntimeErrortest/built-ins/RegExp/prototype/Symbol.replace/fn-invoke-this-no-strict.jstest/built-ins/RegExp/prototype/Symbol.split/splitter-proto-from-ctor-realm.js— RuntimeErrorCompiled (6, two shared with interpreter):
test/built-ins/RegExp/prototype/Symbol.match/builtin-infer-unicode.jstest/built-ins/RegExp/prototype/Symbol.match/builtin-success-u-return-val-groups.jstest/built-ins/RegExp/prototype/Symbol.search/u-lastindex-advance.jstest/built-ins/RegExp/prototype/Symbol.split/u-lastindex-adv-thru-match.jstest/built-ins/RegExp/prototype/Symbol.replace/fn-invoke-this-no-strict.js(also fails interpreted)test/built-ins/RegExp/prototype/Symbol.split/splitter-proto-from-ctor-realm.js— RuntimeError (also fails interpreted)Work clusters
1. Unicode-flag
lastIndexadvancement (4 compiled tests) — highest leverageSymbol.match/builtin-infer-unicode.jsSymbol.match/builtin-success-u-return-val-groups.jsSymbol.search/u-lastindex-advance.jsSymbol.split/u-lastindex-adv-thru-match.jsThe compiled exec loop needs surrogate-pair-aware index stepping when the
uflag is set (§22.2.7.3 AdvanceStringIndex). The interpreter already passes these, so the C# reference exists — this is an IL port of the unicode advance step.2. Replacer-fn
thisin non-strict mode (1 test, both modes)Symbol.replace/fn-invoke-this-no-strict.jsThe replacer function passed to
Symbol.replacemust be invoked withundefinedthis, which in non-strict mode coerces to the global object. Both modes currently mishandle thethisbinding.3. Cross-realm prototype provenance (1 test, both modes)
Symbol.split/splitter-proto-from-ctor-realm.jsThe species-constructed splitter must take its prototype from the constructor's realm. This likely needs realm support SharpTS does not model; may be out of scope — acceptable to mark
Skippedwith a feature tag if realms aren't planned.Also (interpreted-only)
Symbol.replace/coerce-global.js— RuntimeError; likely related to cluster 1's global/unicode flag handling on the interpreter side.Acceptance
RegExp/prototype/*orString/prototype/*baselines.Related
Follow-up to #101. Part of #69.