Fix truthiness call check for this-property access (#38163)

This commit is contained in:
Andrew Branch
2020-04-24 13:02:17 -07:00
committed by GitHub
parent 38ff7762ec
commit fe140acc09
6 changed files with 47 additions and 1 deletions

View File

@@ -31909,7 +31909,9 @@ namespace ts {
let childExpression = childNode.parent;
while (testedExpression && childExpression) {
if (isIdentifier(testedExpression) && isIdentifier(childExpression)) {
if (isIdentifier(testedExpression) && isIdentifier(childExpression) ||
testedExpression.kind === SyntaxKind.ThisKeyword && childExpression.kind === SyntaxKind.ThisKeyword
) {
return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression);
}