Make comma at the end of line optional

Claude Pache claude.pache at gmail.com
Tue Sep 12 16:34:36 UTC 2017


> Le 12 sept. 2017 à 18:00, Алексей <agat00 at gmail.com> a écrit :
> 
> Sorry, but I don't see any problems with example you provide:
> 
> const object = {
>   get // not a complete declaration statement - so no implicit comma here
>   y: 2 // continuation of a previous line
> 
>   z: x // complete declaration statement and next line is not an operator - implicit comma here
>   in: "foo"
> }


This is not how ASI works. A implicit semicolon is not added when a declaration would be complete, but when the next token would produce a syntax error. —Claude



More information about the es-discuss mailing list