TypeScript/tests/cases/conformance/salsa/lateBoundAssignmentDeclarationSupport6.ts
Wesley Wigham 293816875c
Support some late-bound special property assignments (#33220)
* Support some late-bound special property assignments

* Integrate PR feedback

* PR feedback

* Enable declaration on core tests

* Specialize type of binary expression used for late binding, speculative fix to navigation bar, merge check and type for elem/property accesses

* Add test showing current nav bar behavior (specifically the lack thereof)
2019-09-27 13:54:50 -07:00

26 lines
688 B
TypeScript

// @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport6.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
function F() {
}
F.prototype.defsAClass = true;
Object.defineProperty(F.prototype, _str, {value: "ok"});
Object.defineProperty(F.prototype, _sym, {value: "ok"});
const inst = new F();
const _y = inst[_str];
const _z = inst[_sym];
module.exports.F = F;
module.exports.S = _sym;
// @filename: usage.js
const x = require("./lateBoundAssignmentDeclarationSupport6.js");
const inst = new x.F();
const y = inst["my-fake-sym"];
const z = inst[x.S];