TypeScript/tests/cases/conformance/salsa/inferringClassMembersFromAssignments7.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

24 lines
407 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @strictNullChecks: true
// @Filename: inferringClassMembersFromAssignments7.js
class C {
constructor() {
var self = this
self.x = 1
self.m = function() {
console.log(self.x)
}
}
mreal() {
var self = this
self.y = 2
}
}
const c = new C()
c.x
c.y
c.m()