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.




Can you point me to one of the threads you mention? A quick search turned up 
nothing on thus earlier, and I should read one of those to get up to speed.

On Mon, Aug 25, 2014 at 3:12 AM, Domenic Denicola
<[email protected]> wrote:

> From: es-discuss [mailto:[email protected]] 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 no longer 
>> trust call, apply and bind, since we cannot easily tell if the function we 
>> want to bind is an arrow function and will silently ignore us.
> There have been multitudes of threads on this before, but the short recap is 
> that arrow functions are functions, not methods. That is, they do not change 
> their behavior depending on what `thisArg` they are called with. Other 
> examples of non-method functions include:
> ```js
> function f(x) {
>   return x * 2;
> }
> var g = (function () { return this.foo; }).bind({ foo: 5 });
> function F(x) {
>   var hidden = x * 2;
>   this.f = function () {
>     return hidden;
>   };
> }
> var h = (new F(12)).f;
> ```
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to