Why is no line break is needed in ArrowFunction?
Eric Suen
eric.suen.tech at gmail.com
Thu Oct 22 05:39:27 UTC 2015
Why not remove Headless Arrow Functions from ExpressionStatement like
FunctionExpression and ObjectLiteral.
then statement like:
var a = i
=> 1
will be
var a = i => 1;
instead of
var a = i;
=> 1;
BTW why Statement[return] exists? or why there is no Statment[break]
or Statement[continue]? did I miss something?
On Thu, Oct 22, 2015 at 4:39 AM, Brian Terlson
<Brian.Terlson at microsoft.com> wrote:
> Sure, this works for syntax questions.
>
>
>
> Today no expression can start with =>, but there is the headless arrows
> proposal[1] which might add one. IIRC we wanted to be future compatible.
>
>
>
> I’m not sure what the motivation for [no LT here] in yield * was, but I
> support it on the grounds that splitting yield and * across lines is bad :-P
> In general better to be more conservative than less, I suppose.
>
>
>
> 1. https://bterlson.github.io/headless-arrows
>
>
>
> From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Eric
> Suen
> Sent: Wednesday, October 21, 2015 12:28 AM
> To: es-discuss at mozilla.org
> Subject: Why is no line break is needed in ArrowFunction?
>
>
>
> Try to write a parser for es6, is this the right place for question about
> syntax?
>
>
>
> There is no expression or statement start with =>, same goes to yield [no
> LineTerminator here] * AssignmentExpression ?
>
>
>
>
> ------------------------------------------------
> Spket IDE - Development Tool for RIA.
>
> http://www.spket.com
--
------------------------------------------------
Spket IDE - Development Tool for RIA.
http://www.spket.com
More information about the es-discuss
mailing list