arrows and a proposed softCall

Brendan Eich brendan at mozilla.com
Tue Jun 5 17:36:31 PDT 2012


Irakli Gozalishvili wrote:
> I would also like to express that I think => with proposed (bound 
> this) semantics, are great. And I don't think it introduces any new 
> issues it's just a sugar for:
>
> function() {  /* … */ }.bind(this)

Not quite, since we do not want to call bind -- so it would be 
unobservable and you couldn't replace Function.prototype.bind with your 
bind-like and have the VM call your replacement.

Also, arrows do not have exactly the same internal and external 
properties that the bound function created by ES5 15.3.4.5 gets, in 
particular [[Construct]]. See the strawman and possibly the latest ES6 
draft for details.

HTH, and not to take away from your endorsement of => at all -- thanks! :-)

/be


More information about the es-discuss mailing list