Please some small improvements

Axel Rauschmayer axel at rauschma.de
Wed Mar 21 01:31:43 PDT 2012


> Do you mean automatic comma insertion? Waldemar pointed out hazards involving [] and other combinations that use a lexeme that can be a prefix bracket form or a binary connective. On that basis I believe TC39 rejected comma elision as proposed for object literal (initialiser, sic, ECMA-262 says) syntax.

No, just that, starting with ES5, you can write a trailing comma (like after `bar`, below). If you combine that with the proposed shorter method syntax for object literals then syntactically, it’s just like replacing each semicolon with a comma, in a hypothetical semicolon-based syntax.

With "semicolon separation", I meant "semicolon-based syntax".

>> I wonder, though, if comma-separation can’t be learned, especially if trailing commas can be added (which is legal in ES5):
>> 
>> let obj = {
>>    foo: 123,
>>    method() {
>>    }
>>    bar: "abc",
>> }
>> 
>> Manageable and the exact analog of semicolon separation.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

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


More information about the es-discuss mailing list