TypeScript/tests/cases/conformance/salsa/lateBoundClassMemberAssignmentJS3.ts
Nathan Shively-Sanders 1ec71f0e0c
Bind alias ThisProperty assignment declarations (#39908)
* Bind alias ThisProperty assignment declarations

This is a quick prototype that does the wrong thing at the wrong time
with the wrong technique.

* Preliminary checker handling for aliases

Duplicative and untested, but I think I updated all the places that need
updating.

* new is error; old one should not have been removed

* I don't even know what's happening with this test

* cleanup and testing in the checker

* binder: use lookupSymbolForNameWorker instead of mutable

This should have about the same behaviour and is much easier to
understand.

Also refactor common code a bit.

* Shorter name of lookupSymbolForName

Once upon a time there was a parent/worker function, but now it's just a
single function again. No need for the -Worker suffix.

* remove oodate comment

* fix switch-case-break lint

* Refactor and move functions

* Rename and improve type of getContextualTypeForAssignmentDeclaration
2020-08-10 16:45:55 -07:00

21 lines
406 B
TypeScript

// @allowJs: true
// @checkJs: true
// @emitDeclarationOnly: true
// @strict: true
// @target: es6
// @declaration: true
// @filename: lateBoundClassMemberAssignmentJS.js
const _sym = Symbol("_sym");
export class MyClass {
constructor() {
var self = this
self[_sym] = "ok";
}
method() {
var self = this
self[_sym] = "yep";
const x = self[_sym];
}
}