Why are ES6 class methods not automatically bound to the instance?

Kevin Smith zenparsing at gmail.com
Wed Feb 10 16:56:56 UTC 2016


>
> One of the wonderful features of many prototype methods is that they can
> be borrowed and .call-ed on other objects (imagine if you couldn't
> `Array.prototype.slice.call(arguments)`!). Auto binding would cripple this
> feature, and it seems like opting out would be harder than opting in.


In general, there is often a tension between making the language "better"
(for some subjective value system) and maintaining consistency.  I think
maintaining consistency was the right call in this case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160210/822624af/attachment.html>


More information about the es-discuss mailing list