Skip to content

Commit

Permalink
Make it work for the if (!fnOrPromise) case
Browse files Browse the repository at this point in the history
instead of just `if (!object.fnOrPromise)`
  • Loading branch information
tjenkinson committed Dec 30, 2024
1 parent 8f8b45c commit 70b70fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44593,7 +44593,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return;
}

const isUsedInBody = inverted && isIfStatement(condExpr.parent) ? testedSymbol && isSymbolUsedInConditionBody(condExpr, condExpr.parent.parent, testedNode, testedSymbol, /*checkForAssignment*/ true) : testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol, /*checkForAssignment*/ false);
const isUsedInBody = inverted && isIfStatement(condExpr.parent) ? testedSymbol && isSymbolUsedInConditionBody(location, condExpr.parent.parent, testedNode, testedSymbol, /*checkForAssignment*/ true) : testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol, /*checkForAssignment*/ false);
const isUsed = testedSymbol && isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|| isUsedInBody;

Expand Down

0 comments on commit 70b70fb

Please sign in to comment.