Bind function without thisArg

T.J. Crowder tj.crowder at
Mon Jan 14 11:48:32 UTC 2019

Although this is easy enough to implement in userland, frankly so was
`bind`. I'd say it comes up often enough to consider. PrototypeJS (remember
PrototypeJS?) called it `curry`.

I'd think the specification changes for it would be minimal as well,
basically A) Allowing Empty as boundThis in BoundFunctionCreate and
[[BoundThis]] on functions; B) Updating [[Call]] on Bound Functions to use
thisArgument when boundThis is Empty; creating a new `Function.prototype`
method (`curry` would be the obvious -- and almost certainly **not**
websafe -- name) to call BoundFunctionCreate with Empty for boundThis.

But I'd be interested to know how difficult it is for JavaScript engines to
implement, since Empty is largely a spec-level concept and it's valid (in
strict mode) to use `null` and `undefined` as boundThis...

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list