mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Include 'delete' operator in control flow analysis
This commit is contained in:
@@ -580,6 +580,9 @@ namespace ts {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
bindBinaryExpressionFlow(<BinaryExpression>node);
|
||||
break;
|
||||
case SyntaxKind.DeleteExpression:
|
||||
bindDeleteExpressionFlow(<DeleteExpression>node);
|
||||
break;
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
bindConditionalExpressionFlow(<ConditionalExpression>node);
|
||||
break;
|
||||
@@ -1055,6 +1058,13 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function bindDeleteExpressionFlow(node: DeleteExpression) {
|
||||
forEachChild(node, bind);
|
||||
if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
bindAssignmentTargetFlow(node.expression);
|
||||
}
|
||||
}
|
||||
|
||||
function bindConditionalExpressionFlow(node: ConditionalExpression) {
|
||||
const trueLabel = createBranchLabel();
|
||||
const falseLabel = createBranchLabel();
|
||||
|
||||
@@ -7563,6 +7563,8 @@ namespace ts {
|
||||
return checkRightHandSideOfForOf((<ForOfStatement>parent).expression) || unknownType;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return getAssignedTypeOfBinaryExpression(<BinaryExpression>parent);
|
||||
case SyntaxKind.DeleteExpression:
|
||||
return undefinedType;
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
return getAssignedTypeOfArrayLiteralElement(<ArrayLiteralExpression>parent, node);
|
||||
case SyntaxKind.SpreadElementExpression:
|
||||
|
||||
Reference in New Issue
Block a user