Yeah, they are pushing it hardly this way. It seems inevitable...
I am willing to accept it, but I'd like to have a clear mapping from
object initializer components into class body components - if it is
there, I don't care about syntax (the main concern for me is, that if
certain things are possible in object initializer, they should be either:
- known to be banned in class, or
- straightforwardly mappable
That brings the question: what about static block? I think it should
have exactly same rules as the basic class block (sans possibility
having its own nested static block). That is, what about that const? Is
data allowed in static (const-only or let as well) but not in class; or
is it possible in class as well (which means, it defines shared data
thing in prototype)?
Axel Rauschmayer wrote:
Brendan argued that if you restrict in class declarations what you can do
syntactically then basing their syntax on object literals will confuse people.
I agree. Based on that and on a recent proposal for a non-braces private
syntax, I’ve updated my class declaration proposal:
https://gist.github.com/1336846
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss