var f = function() { return this; }
var g = f.bind(???);
g.apply({ "foo": "bar" }).foo // expect "bar"
Function.prototype.bind set's the thisArg to a certain value. Is there any
way to leave it flexible to be overwritten using `.call` and `.apply` later
on?
Is there any ES:Harmony/strawman proposal for this?
If there is not I propose using `undefined` to tell Function.prototype.bind
to leave thisArg flexible.
The use case would be using .bind to curry parameters without effecting
this.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss