Skip to content

Commit

Permalink
fix comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuiRuTian committed Jun 7, 2020
1 parent 52a8e26 commit 12ab497
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21203,15 +21203,15 @@ namespace ts {
let notNullOrUndefinedFilter = false; // the aim of this filter is type has 'undefined',filter it out from result.
const isExpressionContainOptionalChain = isAccessExpressionContainOptionalChain(typeOfExpr.expression);
// ~undefined means other values except undefiend. boolean, bigint....
if ((assumeTrue && literal.text !== "undefined")||(!assumeTrue && literal.text === "undefined")) {
if ((assumeTrue && literal.text !== "undefined") || (!assumeTrue && literal.text === "undefined")) {
// !== undefined
// === ~undefined
// use full expression to narrow
propertyTypeArray = narrowUnionTypeWithPropertyPathAndExpression(<UnionType>type, typeOfExpr.expression,/* optionalChainSlice */ false);
notNullOrUndefinedFilter = true;
}
else {
// !== ~undefined, === undefined, !==undefined
// !== ~undefined, === undefined
// use non-OptionalChain part to narrow
propertyTypeArray = narrowUnionTypeWithPropertyPathAndExpression(<UnionType>type, typeOfExpr.expression,/* optionalChainSlice */ true);
if (isExpressionContainOptionalChain) {
Expand Down

0 comments on commit 12ab497

Please sign in to comment.