addClassStaticThisReferences: Don't cross class boundary (#24860)

This commit is contained in:
Andy 2018-06-11 10:51:11 -07:00 committed by GitHub
parent e5597eec81
commit 1aad3c6273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -1040,7 +1040,7 @@ namespace ts.FindAllReferences.Core {
if (node.kind === SyntaxKind.ThisKeyword) {
addRef(node);
}
else if (!isFunctionLike(node)) {
else if (!isFunctionLike(node) && !isClassLike(node)) {
node.forEachChild(cb);
}
});

View file

@ -4,7 +4,12 @@
//// static s() {
//// [|this|];
//// }
//// static get f() { return [|this|]; }
//// static get f() {
//// return [|this|];
////
//// function inner() { this; }
//// class Inner { x = this; }
//// }
////}
const [r0, r1, r2] = test.ranges();