mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address CR feedback
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
export const enum ModuleInstanceState {
|
||||
@@ -953,7 +954,7 @@ namespace ts {
|
||||
}
|
||||
if ((expression.kind === SyntaxKind.TrueKeyword && flags & FlowFlags.FalseCondition ||
|
||||
expression.kind === SyntaxKind.FalseKeyword && flags & FlowFlags.TrueCondition) &&
|
||||
!isExpressionOfOptionalChainRoot(expression) && !isQuestionQuestionExpression(expression.parent)) {
|
||||
!isExpressionOfOptionalChainRoot(expression) && !isNullishCoalesce(expression.parent)) {
|
||||
return unreachableFlow;
|
||||
}
|
||||
if (!isNarrowingExpression(expression)) {
|
||||
|
||||
@@ -5953,7 +5953,7 @@ namespace ts {
|
||||
return isOptionalChainRoot(node.parent) && node.parent.expression === node;
|
||||
}
|
||||
|
||||
export function isQuestionQuestionExpression(node: Node) {
|
||||
export function isNullishCoalesce(node: Node) {
|
||||
return node.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>node).operatorToken.kind === SyntaxKind.QuestionQuestionToken;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user