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
Function.prototype.call.bind(someMethod) — the "uncurry-this" idiom —
returns a function that ignores its bound this and yields undefined when
called. This happens even for plain objects, so it's not a builtin-descriptor
issue.
constcall=Function.prototype.call;typeofcall// "function" ✓typeofcall.bind// Perry: undefined | Node: "function" ✗ (reading .bind as a value)constb=call.bind(x)// typeof b === "function" (the .bind(...) call form is special-cased)b(obj,"a")// undefined ✗ — the bound `this` (the target method) is never applied
So Function.prototype.call is reified as a callable, but:
reading .bindas a value off it returns undefined, and
the special-cased call.bind(target) produces a bound function that does
not invoke target with the forwarded (thisArg, ...args).
Why it's high-leverage
This is the exact shape test262's harness/propertyHelper.js uses:
verifyProperty (and verifyCallableProperty, verifyAccessorProperty)
call __hasOwnProperty(obj, name) as their first assertion, so every verifyProperty-based positive test262 case fails here before checking
anything else — independent of whether the underlying descriptor is correct.
Fixing this unblocks the entire propertyHelper.js-based slice of the suite
at once (the ~131 "name/length should be an own property" cluster from #3655
and many more).
User-function .bind works (f.bind({v:10})(5) is correct); the gap is
specifically binding the reified Function.prototype.call / .apply
native methods and reading .bind/.call/.apply off them as values.
Found while implementing #3655 (built-in name/length descriptors).
Activity
fix(runtime): make Function.prototype.call.bind(method) uncurry-this …
fix(runtime): a globalThis constructor called as a value is not a met…
fix(runtime): a globalThis constructor called as a value is not a met…
fix(runtime): Response/Request subclass body methods recursed to {} s…