@@ -645,6 +645,13 @@ namespace ts {
645645 } ;
646646 }
647647
648+ function createFlowLoopLabel ( ) : FlowLabel {
649+ return {
650+ kind : FlowKind . LoopLabel ,
651+ antecedents : undefined
652+ } ;
653+ }
654+
648655 function addAntecedent ( label : FlowLabel , antecedent : FlowNode ) : void {
649656 if ( antecedent . kind !== FlowKind . Unreachable && ! contains ( label . antecedents , antecedent ) ) {
650657 ( label . antecedents || ( label . antecedents = [ ] ) ) . push ( antecedent ) ;
@@ -755,7 +762,7 @@ namespace ts {
755762 }
756763
757764 function bindWhileStatement ( node : WhileStatement ) : void {
758- const preWhileLabel = createFlowLabel ( ) ;
765+ const preWhileLabel = createFlowLoopLabel ( ) ;
759766 const preBodyLabel = createFlowLabel ( ) ;
760767 const postWhileLabel = createFlowLabel ( ) ;
761768 addAntecedent ( preWhileLabel , currentFlow ) ;
@@ -768,7 +775,7 @@ namespace ts {
768775 }
769776
770777 function bindDoStatement ( node : DoStatement ) : void {
771- const preDoLabel = createFlowLabel ( ) ;
778+ const preDoLabel = createFlowLoopLabel ( ) ;
772779 const preConditionLabel = createFlowLabel ( ) ;
773780 const postDoLabel = createFlowLabel ( ) ;
774781 addAntecedent ( preDoLabel , currentFlow ) ;
@@ -781,7 +788,7 @@ namespace ts {
781788 }
782789
783790 function bindForStatement ( node : ForStatement ) : void {
784- const preLoopLabel = createFlowLabel ( ) ;
791+ const preLoopLabel = createFlowLoopLabel ( ) ;
785792 const preBodyLabel = createFlowLabel ( ) ;
786793 const postLoopLabel = createFlowLabel ( ) ;
787794 bind ( node . initializer ) ;
@@ -796,7 +803,7 @@ namespace ts {
796803 }
797804
798805 function bindForInOrForOfStatement ( node : ForInStatement | ForOfStatement ) : void {
799- const preLoopLabel = createFlowLabel ( ) ;
806+ const preLoopLabel = createFlowLoopLabel ( ) ;
800807 const postLoopLabel = createFlowLabel ( ) ;
801808 addAntecedent ( preLoopLabel , currentFlow ) ;
802809 currentFlow = preLoopLabel ;
@@ -943,7 +950,7 @@ namespace ts {
943950 }
944951
945952 function bindLabeledStatement ( node : LabeledStatement ) : void {
946- const preStatementLabel = createFlowLabel ( ) ;
953+ const preStatementLabel = createFlowLoopLabel ( ) ;
947954 const postStatementLabel = createFlowLabel ( ) ;
948955 bind ( node . label ) ;
949956 addAntecedent ( preStatementLabel , currentFlow ) ;
0 commit comments