You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime/object-model: pass correct this binding to callback invocations such as String.replace #3578
Pry code example not available? #213 language/function-code/10.4.3-1-102-s.js (runtime-fail: Uncaught exception: Expected SameValue(«"a\u0000"», «"aa"») to be true)
Perry actual behavior from report
1 x runtime-fail: Uncaught exception: "ab".replace("b", f) Expected SameValue(«"a\u0000"», «"aa"») to be true
1 x runtime-fail: Uncaught exception: Expected SameValue(«"a\u0000"», «"aa"») to be true
Node / ECMAScript expected behavior
Built-ins that invoke user callbacks pass the correct callback this value and arguments, including String.prototype.replace replacement callbacks.
Likely subsystem
built-in callback dispatch / implicit this handling
Acceptance criteria
The String.replace callback rows produce "aa" rather than NUL/undefined-derived output.
Strict and sloppy callback forms agree with Node.
Existing replacement-string behavior does not regress.
Validation
Run the Test262 differential against the affected area and confirm these rows leave the gap report:
Verified resolved against current main (built fresh from origin/main, 207 commits ahead of an older checkout) and compared byte-for-byte to node --experimental-strip-types. Callback this-binding for String.replace matches node: ab.replace(b, fn) and the regex-pattern callback form both produce node-identical output with no NUL/undefined-derived results. Closing as resolved.
Activity
proggeramlug commentedon Jun 3, 2026
Verified resolved against current main (built fresh from origin/main, 207 commits ahead of an older checkout) and compared byte-for-byte to node --experimental-strip-types. Callback this-binding for String.replace matches node: ab.replace(b, fn) and the regex-pattern callback form both produce node-identical output with no NUL/undefined-derived results. Closing as resolved.