We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 1.8.7
Code
class A { a = true; constructor() { } } class B extends A { b = true; constructor() { super(); } } new B();
Expected behavior: The b field should be set to true, then super() called.
Actual behavior: The super constructor is called first, then b field is initialized.
Generated JS
var B = (function (_super) { __extends(B, _super); function B() { _super.call(this); this.b = true; } return B; }(A));
The text was updated successfully, but these errors were encountered:
This is not how classes work. In ES6 it is illegal to use this before calling super.
this
super
See also #1617
Sorry, something went wrong.
No branches or pull requests
TypeScript Version: 1.8.7
Code
Expected behavior:
The b field should be set to true, then super() called.
Actual behavior:
The super constructor is called first, then b field is initialized.
Generated JS
The text was updated successfully, but these errors were encountered: