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
Prototype method replacement not observed through a typed-parameter receiver #9131
Found while auditing #9124 and re-checked on #9130. Both reproduce identically on main, so this predates the inline-probe series — but it lives in exactly the code that series is changing (method_override.rs's guard selection), so it is worth pinning before more optimization lands on top.
Related shapes that are also wrong on main
From the same 23-shape probe, all identical on main and on #9124/#9130:
shape
node
perry
Object.setPrototypeOf(c, {inc: () => 777}) then c.inc()
777
2
Object.setPrototypeOf(p, Q.prototype) then p.m()
"b"
"a"
c.inc.call(otherInstance)
[101,101,1]
TypeError
get m() { return () => this.v * 7 } then g.m()
21
TypeError
delete c.v mid-loop then c.inc()
NaN
21
The first two are the same root as the headline case (a stale prototype edge); the last three look independent and may deserve splitting out once someone digs in.
Why it matters beyond spec conformance
Monkey-patching a prototype is how a lot of instrumentation, test doubles and polyfills work. Silently continuing to call the old body — with no error — is the failure mode most likely to be misdiagnosed as "my mock didn't get applied".
Activity
fix(runtime): observe prototype replacement in method calls (PerryTS#…
fix(runtime): observe prototype replacement in method calls (PerryTS#…
fix(runtime): observe prototype replacement in method calls (#9169)