Make comma at the end of line optional

Bob Myers rtm at gol.com
Tue Sep 12 14:31:32 UTC 2017


Yes, ASI has been such a great success, let's extend it to commas.

On Tue, Sep 12, 2017 at 8:00 PM, Алексей <agat00 at gmail.com> wrote:

> Hi all
>
> Now we have a great syntax improvement that allows us to put comma at the
> end of arguments lists, object and array definitions. So in multiline
> definition last line could have the same signature as others (not only in
> multiline, but multiline definition benefits the most).
>
> I would like to propose syntax that would allow to each line looks like
> the last:
>
> const object = {
>   x: 1
>   y: 2
>   z: 3
> }
>
> The rule here: for multiline arguments list, object or array declaration
> if line is a complete statement and next line is not an operator than
> consider it as complete argument (field, element) declaration.
>
> Not an operator so you could use
>
> const condition = true
> const objext = {
>   x: condition
>     ? 0
>     : 1
>   y: 2
>   z: 3
> }
>
> It is really like ASI but without bugs with "[", "(" and "/" - they should
> be consider as a start of a new declaration
>
> _______________________________________________
> 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/20170912/800334d0/attachment.html>


More information about the es-discuss mailing list