mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
More fixes to uncalled function checks in && expressions (#49868)
This commit is contained in:
@@ -33955,7 +33955,11 @@ namespace ts {
|
||||
const operator = operatorToken.kind;
|
||||
if (operator === SyntaxKind.AmpersandAmpersandToken || operator === SyntaxKind.BarBarToken || operator === SyntaxKind.QuestionQuestionToken) {
|
||||
if (operator === SyntaxKind.AmpersandAmpersandToken) {
|
||||
const parent = walkUpParenthesizedExpressions(node.parent);
|
||||
let parent = node.parent;
|
||||
while (parent.kind === SyntaxKind.ParenthesizedExpression
|
||||
|| isBinaryExpression(parent) && (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken || parent.operatorToken.kind === SyntaxKind.BarBarToken)) {
|
||||
parent = parent.parent;
|
||||
}
|
||||
checkTestingKnownTruthyCallableOrAwaitableType(node.left, isIfStatement(parent) ? parent.thenStatement : undefined);
|
||||
}
|
||||
checkTruthinessOfType(leftType, node.left);
|
||||
|
||||
Reference in New Issue
Block a user