On Feb 12, 2015, at 7:01 PM, Michael Ficarra 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.

This has been discussed in the past, if you should the archives of this list.

Trailing comma are intended to make it easy for for humans or machines to 
append additional items to the source code of a list.
But, a rest item must always be the last (right-most)  item of a list. There is 
no possibility of adding something to its right and hence no reason to allow a 
training comma.

Allen


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

Reply via email to