ECMA-262: ElementList : ... AssignmentExpression? Wtf?

Logan Smyth loganfsmyth at gmail.com
Mon Oct 30 18:58:52 UTC 2017


Assuming I'm following your question, it seems like the confusion here is
that `AssignmentExpression`, name-wise, seems like it is only for
assignment, but in reality most of the other expression grammars are nested
inside it? If you look at
https://www.ecma-international.org/ecma-262/8.0/#sec-expressions you can
see for instance

 [image: Inline image 1]

and the `ConditionalExpression` drills down even further, eventually
reaching all of the normal "expression" types that you'd expect in JS.

`AssignmentExpression` in the ECMAScript grammar essentially translates to
"any expression except comma expressions.

On Sun, Oct 29, 2017 at 7:53 PM, Brendan Eich <brendan.eich at gmail.com>
wrote:

> Expression is .comma expression so can't be used without fatal ambiguity:
> is [a,,b] [(a,b)] or [(a), (b)]? It's the latter by using
> AssignmentExpression. If it were PrimaryExpression, ever expression using a
> binary operator would need to be parenthesized.
>
> Is the "Dragon Book" still in print? Recommended.
>
> /be
>
> On Sun, Oct 29, 2017 at 5:49 AM Uncloud Group <hydroperhh at gmail.com>
> wrote:
>
>> The first example was meant to be [ a, b ]. Sorry.
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> 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/20171030/986c7a6b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-10-30 at 11.54.52 AM.png
Type: image/png
Size: 157164 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171030/986c7a6b/attachment-0001.png>


More information about the es-discuss mailing list