super.m() calls the method as declared in the class body and ignores a later patch of the parent prototype.
class B { m() { return 2; } }
class C extends B { n() { return super.m() + 10; } }
(B.prototype as any).m = () => 3;
console.log(new C().n()); // node: 13 perry: 12
Per spec, super.m is a property lookup on [[HomeObject]].[[GetPrototypeOf]]() (here B.prototype), so it must see the patch and also a relinked prototype (Object.setPrototypeOf(C.prototype, X)). perry appears to bind super.m() statically to B's declared method.
Found while fixing #11758; related to the prototype-relink work in #11738.
super.m()calls the method as declared in the class body and ignores a later patch of the parent prototype.Per spec,
super.mis a property lookup on[[HomeObject]].[[GetPrototypeOf]]()(hereB.prototype), so it must see the patch and also a relinked prototype (Object.setPrototypeOf(C.prototype, X)). perry appears to bindsuper.m()statically toB's declared method.Found while fixing #11758; related to the prototype-relink work in #11738.