-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: API: TransformsRelates to the public transform APIRelates to the public transform APINeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.
Milestone
Description
TypeScript Version: Version 2.7.0-dev.20180109
Code
class A {
test() {}
}
class B extends A {
async test() {
return super.test();
}
}Expected behavior:
TypeScript should not emit code that accesses properties by string name, as this breaks optimizers such as Closure Compiler or Uglify with property renaming enabled.
Actual behavior:
class A {
test() { }
}
class B extends A {
test() {
const _super = name => super[name];
return __awaiter(this, void 0, void 0, function* () {
return _super("test").call(this);
});
}
}_super("test") boils down to super['test'], which breaks when test was renamed by an optimizing compiler.
takamori
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: API: TransformsRelates to the public transform APIRelates to the public transform APINeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.