Skip to content

Fix compat-table failures: Array.at, AnnexB if-decl, Proxy observable gets#2365

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:compat-table
Mar 26, 2026
Merged

Fix compat-table failures: Array.at, AnnexB if-decl, Proxy observable gets#2365
lahma merged 1 commit into
sebastienros:mainfrom
lahma:compat-table

Conversation

@lahma

@lahma lahma commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bug fixes (commit 1):

  • Fix Array.prototype.at() returning wrong value for negative out-of-bounds indices ([1,2,3].at(-4) returned 1 instead of undefined) — ulong cast truncated negative doubles to 0
  • Fix AnnexB if-decl-else-decl with same function name in both branches — sibling branches incorrectly blocked each other via effectiveLexicalNames
  • Use spec RegExpCreate instead of full RegExp.Construct in String.prototype.match/search to avoid extra IsRegExp call (observable extra Symbol.match access through Proxy)
  • Remove observable sticky property read in RegExp.prototype[Symbol.replace] fast path — derive from already-read flags string
  • Fix String.prototype.split to use direct JsRegExp type check instead of IsRegExp() to avoid observable Symbol.match access

Found via compat-table runner, cross-referenced with ECMAScript spec and V8 behavior.

Test plan

  • Full test262 suite: 95,985 passed, 0 failures (+4 new passing from AsyncIterator)
  • Compat-table ES5: 73/73 (100%)
  • Compat-table ES6: 697/700 (was 692, +5)
  • Compat-table ES2016+: 228/250 (was 227, +1)
  • Compat-table esnext: 34/43 (was 17, +17)
  • Compat-table esintl: 29/29 (100%)

🤖 Generated with Claude Code

… gets

- Fix Array.prototype.at() returning wrong value for negative out-of-bounds
  indices by changing ulong to long (C# casts negative double to ulong as 0)
- Fix AnnexB if-decl-else-decl with same function name in both branches by
  not adding to effectiveLexicalNames for IfStatement siblings
- Use RegExpCreate instead of RegExp.Construct in String.prototype.match/search
  to avoid extra IsRegExp call (observable Symbol.match access through Proxy)
- Remove observable sticky property read in RegExp.prototype[Symbol.replace]
  fast path by deriving from already-read flags string
- Fix String.prototype.split to use direct JsRegExp check instead of IsRegExp
  to avoid observable Symbol.match access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lahma
lahma enabled auto-merge (squash) March 26, 2026 08:00
@lahma
lahma merged commit 3fa9f68 into sebastienros:main Mar 26, 2026
4 checks passed
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