Make comma at the end of line optional

Алексей agat00 at gmail.com
Tue Sep 12 16:43:00 UTC 2017


Yes you are right it is not related to ASI in the implementation details.
Only in form of usage

2017-09-12 19:40 GMT+03:00 Naveen Chawla <naveen.chwl at gmail.com>:

> I don't think ASI matters in relation to this proposal
>
> On Tue, 12 Sep 2017 at 22:05 Алексей <agat00 at gmail.com> wrote:
>
>> Yes, I have correct my self about it in a next letter. The point is that
>> it doesn't change the rule
>>
>> 2017-09-12 19:32 GMT+03:00 Jeremy Martin <jmar777 at gmail.com>:
>>
>>>   const object = {
>>>     get // not a complete declaration statement - so no implicit comma
>>> here
>>>     y: 2 // continuation of a previous line
>>>   }
>>>
>>> The `get` declaration actually *is* a valid declaration (see shorthand
>>> property names here: https://developer.mozilla.org/en-US/docs/Web/
>>> JavaScript/Reference/Operators/Object_initializer#
>>> New_notations_in_ECMAScript_2015).
>>>
>>>
>>> On Tue, Sep 12, 2017 at 12:00 PM, Алексей <agat00 at gmail.com> wrote:
>>>
>>>> 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"
>>>> }
>>>>
>>>> 2017-09-12 18:53 GMT+03:00 Claude Pache <claude.pache at gmail.com>:
>>>>
>>>>> There are [no LineTerminator here] rules in the ES grammar, in order
>>>>> to prevent the most pernicious trap when using ASI:
>>>>>
>>>>> ```
>>>>> return // implicit semicolon here
>>>>> a = b
>>>>> ```
>>>>>
>>>>> Those [no LineTerminator here] rules have not been included in
>>>>> constructs that don’t need them. As a result:
>>>>>
>>>>> ```
>>>>> const object = {
>>>>>     get // no implicit comma here
>>>>>     y: 2
>>>>>
>>>>>     z: x // no implicit comma here
>>>>>     in: "foo"
>>>>> }
>>>>> ```
>>>>>
>>>>> So, no, it’s not a good idea.
>>>>>
>>>>> —Claude
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> es-discuss mailing list
>>>> es-discuss at mozilla.org
>>>> https://mail.mozilla.org/listinfo/es-discuss
>>>>
>>>>
>>>
>>>
>>> --
>>> Jeremy Martin
>>> 661.312.3853 <(661)%20312-3853>
>>> @jmar777 <https://twitter.com/jmar777> / @j <https://stream.live/j>
>>>
>>>
>> _______________________________________________
>> 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/8ecf1205/attachment-0001.html>


More information about the es-discuss mailing list