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

2016-02-10 Thread Sam Gluck
Hi all, Hope this is the right place for a purely out-of-interest query - if not, apologies, please ignore! Why are methods on an ES6 class not automatically bound to their instance? Is there any public documentation/conversation, or reasoning, that can explain this decision? (I couldn't find

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

2016-02-10 Thread JD Isaacks
Sorry the link was broke in my last email (the topic should be "concise-method-binding"): https://esdiscuss.org/topic/concise-method-binding ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2016-02-10 Thread JD Isaacks
Does anyone know why it keeps cutting off the end of my link? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2016-02-10 Thread Kevin Smith
> > 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.

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

2016-02-10 Thread Mark S. Miller
Hi Jordan, this is an excellent point. I can't say I remember it being raised, but it would certainly have been adequate to kill any proposal that this be the default behavior. On Wed, Feb 10, 2016 at 8:22 AM, Jordan Harband wrote: > One of the wonderful features of many

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

2016-02-10 Thread JD Isaacks
I proposed a way to make method easily bindable in class definitions or object literals here: https://esdiscuss.org/topic/concise-method-binding ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2016-02-10 Thread Jordan Harband
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. I'm not sure

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

2016-02-10 Thread Mark S. Miller
On Wed, Feb 10, 2016 at 7:11 AM, Sam Gluck wrote: > Hi all, > > Hope this is the right place for a purely out-of-interest query - if not, > apologies, please ignore! > > Why are methods on an ES6 class not automatically bound to their instance? > Is there any public