TypeScript/tests/cases/fourslash/referencesForStringLiteralPropertyNames7.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

17 lines
722 B
TypeScript

/// <reference path='fourslash.ts'/>
// @Filename: foo.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}someProperty|]": 0|] }
////[|x["[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}someProperty|]"] = 3;|]
////[|x.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}someProperty|] = 5;|]
const [r0Def, r0, r1Def, r1, r2Def, r2] = test.ranges();
const ranges = [r0, r1, r2];
verify.referenceGroups(r0, [{ definition: '(property) "someProperty": number', ranges }]);
verify.referenceGroups([r1, r2], [
{ definition: '(property) "someProperty": number', ranges },
]);