Finding a "safety syntax" for classes
khs4473 at gmail.com
Tue Mar 20 12:05:56 PDT 2012
> I do think that class declarations should be hoisted, both in the sense of
> being in scope for the whole containing block (as with let and function)
> and in the sense of being initialized before the block begins executing (as
> with function).
I've been on the fence on the hoisting issue. On the one hand, they're
"declarations", and sugar for functions, so maybe they should be hoisted.
If you want to have statics though (which I realize is being put aside for
this discussion), then they have to be initialized somewhere. What are
your thoughts on this?
> My only syntactic quibble: `constructor` is so inconveniently long. I've
> argued in the past for `new` as special syntax in class bodies that
> indicates a constructor.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss