Closed
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.