extends keyword instead of <superclass ... >

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Sat Mar 26 14:31:51 PDT 2011


Hi,

Just a small note on 
http://wiki.ecmascript.org/doku.php?id=strawman:super_in_object_initialisers 
(reading currently)

Why not just to use already reserved `extends` keyword for specifying a 
superclass? These XML-like braces looks not so elegant.

Coffee users the same classes syntactic sugar as planned for ES6: 
http://jashkenas.github.com/coffee-script/#classes and also reuses 
familiar (for all?) `extends` keyword of ES3.

P.S.:

This (XML-like syntax) relates also to other meta-properties/attributes 
in object initialisers. I prefer to use @ instead:

let foo = {
   @proto: bar,
   @sealed,
   move: # (x, y) {
     ...
   }
};

Though, again, e.g. Coffee (on Ruby's style) users `@` for `this`. Does 
JS need this sugar for `this`? In this case (since # is planned to be 
used actively) meta-properties can be:

let foo = {
   #proto: bar,
   #sealed,
   move: # (x, y) {
     ...
   }
};

Dmitry.


More information about the es-discuss mailing list