Closed
Description
ES6 disallow to use this before super call.
class Aaa {
constructor(v: () => number) {
}
}
class Bbb extends Aaa {
vv: number;
constructor() {
this.vv = 111;
super(this.vvv);
}
vvv(): number { return 0; }
}
The line "this.vv = 111;" must be after super statement.
The super statement also cannot contain this usage.
Compilation to ES6 gives:
class Aaa {
constructor(v) {
}
}
class Bbb extends Aaa {
constructor() {
this.vv = 111;
super(this.vvv);
}
vvv() { return 0; }
}
So even if TS wants to relax "this usage before super" (which i doubt), then it must fix in generated ES6 code.