TypeScript/tests/cases/conformance/async/es2017/asyncMethodWithSuperConflict_es6.ts
Martin Probst 539c455942 Rename to _superIndex to test conflict
Change-Id: I30af09343446126ba73ed40199ecc3f0ed515b3e
2018-10-04 08:07:42 +02:00

60 lines
1.3 KiB
TypeScript

// @target: es6
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
const _super = null;
const _superIndex = null;
// call with property access
super.x();
// call additional property.
super.y();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const _super = null;
const _superIndex = null;
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
}
}