Exclude FlowSwitchClause from flow graph for case expressions
This commit is contained in:
parent
c2730ce659
commit
a8a8826f69
1 changed files with 11 additions and 0 deletions
|
@ -551,6 +551,9 @@ namespace ts {
|
|||
case SyntaxKind.CaseBlock:
|
||||
bindCaseBlock(<CaseBlock>node);
|
||||
break;
|
||||
case SyntaxKind.CaseClause:
|
||||
bindCaseClause(<CaseClause>node);
|
||||
break;
|
||||
case SyntaxKind.LabeledStatement:
|
||||
bindLabeledStatement(<LabeledStatement>node);
|
||||
break;
|
||||
|
@ -989,6 +992,14 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
function bindCaseClause(node: CaseClause): void {
|
||||
const saveCurrentFlow = currentFlow;
|
||||
currentFlow = preSwitchCaseFlow;
|
||||
bind(node.expression);
|
||||
currentFlow = saveCurrentFlow;
|
||||
forEach(node.statements, bind);
|
||||
}
|
||||
|
||||
function pushActiveLabel(name: string, breakTarget: FlowLabel, continueTarget: FlowLabel): ActiveLabel {
|
||||
const activeLabel = {
|
||||
name,
|
||||
|
|
Loading…
Reference in a new issue