PSA: Stricter classes in 0.86

Skip to first unread message

Erik Arvidsson

Mar 3, 2015, 11:14:55 AM3/3/15
To better align with ES6 we've added a bunch of restrictions related
to this and super in classes.

1. is only allowed inside methods (that includes class
constructor as well as getters and setters).
2. super() is only allowed in derived class constructors.
3. A derived class constructor must call super().
4. In a derived class constructor you cannot access this before
calling super() (in ES6 this is enforced at runtime using a TDZ but in
traceur we only enforce this statically so there will be some edge
cases where we are not compliant).

Reply all
Reply to author
0 new messages