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
When this code is compiled to ES5 on nightly (4.7.0-dev.20220419)
4.7.0-dev.20220419
class A { public constructor() { console.log("A") } } class B extends A { constructor() { "ngInject"; console.log("B") super(); } } const b = new B();
it results with:
"use strict"; var __extends = (this && this.__extends) || (function () { /* implementation omitted for brevity */ })(); var A = (function () { function A() { console.log("A"); } return A; }()); var B = (function (_super) { __extends(B, _super); function B() { "ngInject"; console.log("B"); _this = _super.call(this) || this; return _super.call(this) || this; } return B; }(A)); var b = new B();
In addition to _super.call(this) being duplicated, this code also fails at runtime because _this is not defined.
_super.call(this)
_this is not defined
constructor, super, ngInject, directive, _this, this
I expect #29374 to have introduced this regression. The code compiles and runs correctly on 4.5.x.
#48671 looks semi-related and it's already been fixed, but my issue seems a bit different.
https://www.typescriptlang.org/play?downlevelIteration=true&removeComments=true&target=1&ts=4.7.0-dev.20220419#code/MYGwhgzhAECC0G8BQBIADgVwEYgJbGmAHsA7CAFwCcNhyjKAKASkSWnY-eLKJAFMAdCCIBzBgCJY4pmw4BfJAqShIMAELQ+AD3J8SAExjxWnbhWq16zE5w7iSIgJIkAVn1riA3LNuFSEXkFhMXE1aR9bCAw0PkYmb04FJTNyaCxoAF5oEj4Ad2g1Zm8gA
The text was updated successfully, but these errors were encountered:
jakebailey
Successfully merging a pull request may close this issue.
Bug Report
When this code is compiled to ES5 on nightly (
4.7.0-dev.20220419
)it results with:
In addition to
_super.call(this)
being duplicated, this code also fails at runtime because_this is not defined
.🔎 Search Terms
constructor, super, ngInject, directive, _this, this
🕗 Version & Regression Information
I expect #29374 to have introduced this regression. The code compiles and runs correctly on 4.5.x.
#48671 looks semi-related and it's already been fixed, but my issue seems a bit different.
⏯ Playground Link
https://www.typescriptlang.org/play?downlevelIteration=true&removeComments=true&target=1&ts=4.7.0-dev.20220419#code/MYGwhgzhAECC0G8BQBIADgVwEYgJbGmAHsA7CAFwCcNhyjKAKASkSWnY-eLKJAFMAdCCIBzBgCJY4pmw4BfJAqShIMAELQ+AD3J8SAExjxWnbhWq16zE5w7iSIgJIkAVn1riA3LNuFSEXkFhMXE1aR9bCAw0PkYmb04FJTNyaCxoAF5oEj4Ad2g1Zm8gA
The text was updated successfully, but these errors were encountered: