Fix uncalled function check usage detection for && expressions (#49157)

This commit is contained in:
Andrew Branch
2022-05-18 13:58:06 -07:00
committed by GitHub
parent ce85d647ef
commit e56a067801
6 changed files with 38 additions and 3 deletions

View File

@@ -38001,7 +38001,7 @@ namespace ts {
const childSymbol = getSymbolAtLocation(childNode);
if (childSymbol && childSymbol === testedSymbol) {
// If the test was a simple identifier, the above check is sufficient
if (isIdentifier(expr)) {
if (isIdentifier(expr) || isIdentifier(testedNode) && isBinaryExpression(testedNode.parent)) {
return true;
}
// Otherwise we need to ensure the symbol is called on the same target