Skip to content

Commit 92212ae

Browse files
committed
More succinct
1 parent 720964f commit 92212ae

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18802,18 +18802,9 @@ namespace ts {
1880218802

1880318803
function isFalseExpression(expr: Expression): boolean {
1880418804
const node = skipParentheses(expr);
18805-
if (node.kind === SyntaxKind.FalseKeyword) {
18806-
return true;
18807-
}
18808-
if (node.kind === SyntaxKind.BinaryExpression) {
18809-
if ((<BinaryExpression>node).operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
18810-
return isFalseExpression((<BinaryExpression>node).left) || isFalseExpression((<BinaryExpression>node).right);
18811-
}
18812-
if ((<BinaryExpression>node).operatorToken.kind === SyntaxKind.BarBarToken) {
18813-
return isFalseExpression((<BinaryExpression>node).left) && isFalseExpression((<BinaryExpression>node).right);
18814-
}
18815-
}
18816-
return false;
18805+
return node.kind === SyntaxKind.FalseKeyword || node.kind === SyntaxKind.BinaryExpression && (
18806+
(<BinaryExpression>node).operatorToken.kind === SyntaxKind.AmpersandAmpersandToken && (isFalseExpression((<BinaryExpression>node).left) || isFalseExpression((<BinaryExpression>node).right)) ||
18807+
(<BinaryExpression>node).operatorToken.kind === SyntaxKind.BarBarToken && isFalseExpression((<BinaryExpression>node).left) && isFalseExpression((<BinaryExpression>node).right));
1881718808
}
1881818809

1881918810
function isReachableFlowNodeWorker(flow: FlowNode, noCacheCheck: boolean): boolean {

0 commit comments

Comments
 (0)