Closed tsuchikazu closed 8 years ago
I see class properties pull request https://github.com/juliankrispel/decaf/pull/29 now. If ES.next is no problem, I want to transpile to 1. ES.next
.
Yea it makes absolute sense, I'm looking into it currently
I'd also use the static property
basically there's two types of class properties
class A
b: 'b'
@c = 'c'
should compile to
class A {
b = 'b';
static c = 'c';
}
Thanks a lot!! :smile:
@tsuchikazu published that on npm as well
This is error report and proposal es6 syntax.
I tried transpile this coffeescript, then get the following error
coffeescript
errors
I propose es6 syntax for this coffeescript transpile.
ES.next
Most simple syntax. But this syntax is still stage 1 proposal. Maybe don't work other npm package. etc recast. ref: jeffmo/es-class-fields-and-static-properties: Stage 1 proposal for declarative class properties in ES
getter and setter for static
This syntax is valid in es6(2015) and declared in class. But this is little complex.
Class and set property
This syntax is valid in es6(2015) and simple. But separated declaring class and static property. ref: Moving to ES6 from CoffeeScript
I think
3. Class and set property
is better. What do you think about it?