Self-recursion and arrow functions

Rick Waldron waldron.rick at gmail.com
Sun Mar 17 19:24:34 PDT 2013


On Sun, Mar 17, 2013 at 9:54 PM, Jorge Chamorro <jorge at jorgechamorro.com>wrote:

> On 18/03/2013, at 01:49, Rick Waldron wrote:
>
> > snip
> > ...and Brendan's point about backwards compatibility is irrefutable:
> >
> > https://mail.mozilla.org/pipermail/es-discuss/2012-January/019860.html
> > snip
>
> How is
>
> ƒ fib(n) { ... }
>

ƒ is not a reserved word, so the following is valid today:

> var ƒ = 1
> ƒ
1

...Which means any code that exists (maybe there is none, but that's not
really the point) will be broken.


> any more backwards incompatible than
>
> const fib = (n) => { ... };
>

const is a reserved word, so the following is a SyntaxError today, which
means it can be "safely" rolled out without breaking code that already
exists:

> var const = 1;
SyntaxError: Unexpected token const


Although, I think François Remy's argument is the most compelling.

Arrow has had consensus for a long time now and is already in the ES6 spec
draft—it's here to stay.

Rick


> ?
> --
> (Jorge)();
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130317/48c00864/attachment-0001.html>


More information about the es-discuss mailing list