Re: Binding arrow functions.

2014-08-25 Thread Till Schneidereit
On Mon, Aug 25, 2014 at 4:30 AM, Boris Zbarsky bzbar...@mit.edu wrote: On 8/24/14, 10:26 PM, Mark Everitt wrote: The problem remains that arrow functions make bind etc. unpredictable. I think part of Domenic's point is that return values of bind() also make bind (and call/apply for that

Re: Binding arrow functions.

2014-08-25 Thread Mark Everitt
I got my lack-of-sleep addled head around this by realising that an arrow function performs like an immediately bound function expression: ```js var test = (function (){ // Do stuff with this... }).bind(this); ``` i.e. Domenic's second example function. Then it was obvious that arrow

Binding arrow functions.

2014-08-24 Thread Mark Everitt
Today I encountered an inconsistency between SpiderMonkey and V8 (in Aurora 33.0a2 (2014-08-24) and Canary 39.0.2135.0 canary (64-bit)). In chrome, I can bind an arrow function, and in firefox I cannot (see this gist: https://gist.github.com/qubyte/43e0093274e793cc82ba) I find reading the ES6

RE: Binding arrow functions.

2014-08-24 Thread Domenic Denicola
From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Mark Everitt There seems to be no clean way to tell apart regular functions and arrow functions (the only way I can do this is by looking at the result of toString). That being the case, arrow functions mean that we can

RE: Binding arrow functions.

2014-08-24 Thread Mark Everitt
Sorry, should have sent this to the group... That seems a little unsatisfactory. I'm aware of the difference in terminology of course. The problem remains that arrow functions make bind etc. unpredictable. You're relying on the programmer to do the right thing and that's a bad idea IMO.

Re: Binding arrow functions.

2014-08-24 Thread Boris Zbarsky
On 8/24/14, 10:26 PM, Mark Everitt wrote: The problem remains that arrow functions make bind etc. unpredictable. I think part of Domenic's point is that return values of bind() also make bind (and call/apply for that matter) unpredictable. -Boris

Re: Binding arrow functions.

2014-08-24 Thread Mark Everitt
Ah, yes I'm seeing the point now. My apologies. The difference between SpiderMonkey and V8 that precipitated this thread has me frustrated. Thanks both. On Mon, Aug 25, 2014 at 3:30 AM, Boris Zbarsky bzbar...@mit.edu wrote: On 8/24/14, 10:26 PM, Mark Everitt wrote: The problem remains that

Re: Binding arrow functions.

2014-08-24 Thread Rick Waldron
On Sun, Aug 24, 2014 at 9:52 PM, Mark Everitt mark.s.ever...@gmail.com wrote: Today I encountered an inconsistency between SpiderMonkey and V8 (in Aurora 33.0a2 (2014-08-24) and Canary 39.0.2135.0 canary (64-bit)). In chrome, I can bind an arrow function, and in firefox I cannot (see this