Skip to content

Commit 955d8e0

Browse files
committed
unify style of the cases
1 parent 538ffd8 commit 955d8e0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/compiler/checker.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40437,7 +40437,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4043740437
}
4043840438
if (isBinaryExpression(node.parent)) {
4043940439
const { left, operatorToken } = node.parent;
40440-
if (isBinaryExpression(left) && (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)) {
40440+
if (isBinaryExpression(left) && operatorToken.kind === SyntaxKind.BarBarToken) {
4044140441
grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(SyntaxKind.QuestionQuestionToken), tokenToString(operatorToken.kind));
4044240442
}
4044340443
}
@@ -40447,8 +40447,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4044740447
grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(SyntaxKind.QuestionQuestionToken));
4044840448
}
4044940449
}
40450-
else if (isBinaryExpression(node.right) && node.right.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
40451-
grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(SyntaxKind.QuestionQuestionToken), tokenToString(node.right.operatorToken.kind));
40450+
else if (isBinaryExpression(node.right)) {
40451+
const { operatorToken } = node.right;
40452+
if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
40453+
grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(SyntaxKind.QuestionQuestionToken), tokenToString(operatorToken.kind));
40454+
}
4045240455
}
4045340456
checkNullishCoalesceOperandLeft(node);
4045440457
checkNullishCoalesceOperandRight(node);

0 commit comments

Comments
 (0)