V8 is implementing arrow functions at the moment so they are incomplete/incorrect. We have not enabled them yet and using the experimental flags will lead to incomplete and incorrect behavior.
On Mon, Aug 25, 2014 at 6:23 AM, Mark Everitt <[email protected]> wrote: > 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 > functions are not really throwing anything new into the mix with regard to > bind, apply, and call. > > > On 25 August 2014 10:54, Till Schneidereit <[email protected]> > wrote: > >> On Mon, Aug 25, 2014 at 4:30 AM, Boris Zbarsky <[email protected]> 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 matter) unpredictable. >>> >> >> More fundamentally, I guess you could say that every function that >> doesn't use `this` makes `bind` unpredictable. Domenic's second example >> shows a function like that. >> >> I would argue that, if anything, arrow functions slightly improve >> predictability: before arrow functions, the only way to meaningfully >> "predict" the change in behavior that `bind` causes for a functions was by >> looking at its source code *and by ensuring that the function hasn't been >> bound already*. For arrow functions, you only need to inspect the source >> code. (Granted, this probably isn't *that* much of a real-world >> improvement.) >> > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > -- erik
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

