(expr)
| 45337 | inAssignmentPattern = saveInAssignmentPattern; |
| 45338 | } |
| 45339 | function isNarrowingExpression(expr) { |
| 45340 | switch (expr.kind) { |
| 45341 | case 79 /* SyntaxKind.Identifier */: |
| 45342 | case 80 /* SyntaxKind.PrivateIdentifier */: |
| 45343 | case 108 /* SyntaxKind.ThisKeyword */: |
| 45344 | case 206 /* SyntaxKind.PropertyAccessExpression */: |
| 45345 | case 207 /* SyntaxKind.ElementAccessExpression */: |
| 45346 | return containsNarrowableReference(expr); |
| 45347 | case 208 /* SyntaxKind.CallExpression */: |
| 45348 | return hasNarrowableArgument(expr); |
| 45349 | case 212 /* SyntaxKind.ParenthesizedExpression */: |
| 45350 | case 230 /* SyntaxKind.NonNullExpression */: |
| 45351 | return isNarrowingExpression(expr.expression); |
| 45352 | case 221 /* SyntaxKind.BinaryExpression */: |
| 45353 | return isNarrowingBinaryExpression(expr); |
| 45354 | case 219 /* SyntaxKind.PrefixUnaryExpression */: |
| 45355 | return expr.operator === 53 /* SyntaxKind.ExclamationToken */ && isNarrowingExpression(expr.operand); |
| 45356 | case 216 /* SyntaxKind.TypeOfExpression */: |
| 45357 | return isNarrowingExpression(expr.expression); |
| 45358 | } |
| 45359 | return false; |
| 45360 | } |
| 45361 | function isNarrowableReference(expr) { |
| 45362 | return ts.isDottedName(expr) |
| 45363 | || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) |
no test coverage detected