Please some small improvements

Axel Rauschmayer axel at rauschma.de
Wed Mar 21 11:13:25 PDT 2012


http://wiki.ecmascript.org/doku.php?id=harmony:object_literals

As far as I can tell, there are no commas after concise methods.

On Mar 21, 2012, at 18:55 , Brendan Eich wrote:

> Confusion: then why did you leave a comma out (it's required in any proposed initialiser syntax) after method's closing brace?
> 
> /be
> 
> Axel Rauschmayer wrote:
>> 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",
> 

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

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



More information about the es-discuss mailing list