Make comma at the end of line optional

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Sep 12 18:35:37 UTC 2017


> On Sep 12, 2017, at 11:22 AM, dante federici <c.dante.federici at gmail.com> wrote:
> 
> The one thing I still have a gripe over is the class definition syntax -- where neither `,` or `;` are used at the end of method expressions.

Look at the grammar.

`;` is not part of the concise method production, but it is still perfectly fine to insert a a `;` at the immediate end of a concise method.  This is exactly like function declarations.  A ‘;` is not a required part of a function declaration, but you can put one there if you want.

```js
function f() {};

class C {
   m() {};
   n() {};
}  //you can put a ;  here, too if you want
```

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170912/208a6606/attachment.html>


More information about the es-discuss mailing list