> Is this simply a mistake in the grammar?

The grammar appears to allow trailing comma after rest elements, so I think 
it’s an implementation error.

> ArrayBindingPattern[Yield,GeneratorParameter] :
>        [ Elisionopt BindingRestElement[?Yield, ?GeneratorParameter]opt ]
>   [ BindingElementList[?Yield, ?GeneratorParameter] ]
>   [ BindingElementList[?Yield, ?GeneratorParameter] , Elisionopt 
> BindingRestElement[?Yield, ?GeneratorParameter]opt]

> On Feb 12, 2015, at 10:01 PM, Michael Ficarra <[email protected]> 
> wrote:
> 
> Is there any reason why a trailing comma is not allowed in an 
> ArrayBindingPattern when it has a BindingRestElement? I noticed yesterday 
> that my parser was erroneously allowing these, but the inconsistency with 
> both ArrayLiterals and ObjectBindingPatterns is bothering me. Is this simply 
> a mistake in the grammar? I understand that we wouldn't want to allow holes 
> or other BindingElements to follow the BindingRestElement, but I don't see a 
> problem with a single trailing comma.
> 
> Michael Ficarra
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to