PSA: Stricter classes in 0.86

21 views
Skip to first unread message

Erik Arvidsson

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

1. super.property 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).

--
erik
Reply all
Reply to author
Forward
0 new messages