How to fix the `class` keyword

Leon Arnott leonarnott at
Thu Mar 5 06:18:03 UTC 2015

Well, they're a distinct special form that can be used in expression
position, and evaluates to a function, so they're definitely, to bring back
an old coin, quasi-literal. (I personally think your reasoning entails that
arrows aren't function literals because of their lexical `this` bindings.)

So, stuff inside class bodies should be considered more like function
statements, not property definitions - even though they have a lot of
*very* property-ish things, like computed names, or shorthand methods, or
accessors, or shorthand generators... :|

And, according to that gist, data properties should be considered to be
like assignment statements. Would that make a hypothetical `class { [foo,
bar] = [1,2]; }` a destructuring or a computed property name? Either answer
seems dissatisfying (the former because it precludes the latter; the latter
because it mis-resembles the former).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list