@@ -2410,9 +2410,9 @@ export class Compiler extends DiagnosticEmitter {
2410
2410
flow . inherit ( condFlow ) ;
2411
2411
2412
2412
// Detect if local flags are incompatible before and after looping, and
2413
- // if so recompile by unifying local flags between iterations.
2413
+ // if so recompile by unifying local flags between iterations. Note that
2414
+ // this may be necessary multiple times where locals depend on each other.
2414
2415
if ( Flow . hasIncompatibleLocalStates ( flowBefore , flow ) ) {
2415
- assert ( ! flowAfter ) ; // should work on the first attempt
2416
2416
outerFlow . popBreakLabel ( ) ;
2417
2417
this . currentFlow = outerFlow ;
2418
2418
return this . doCompileDoStatement ( statement , flow ) ;
@@ -2603,9 +2603,9 @@ export class Compiler extends DiagnosticEmitter {
2603
2603
) ;
2604
2604
2605
2605
// Detect if local flags are incompatible before and after looping, and if
2606
- // so recompile by unifying local flags between iterations.
2606
+ // so recompile by unifying local flags between iterations. Note that this
2607
+ // may be necessary multiple times where locals depend on each other.
2607
2608
if ( Flow . hasIncompatibleLocalStates ( flowBefore , flow ) ) {
2608
- assert ( ! flowAfter ) ; // should work on the first attempt
2609
2609
assert ( ! bodyFlow . hasScopedLocals ) ;
2610
2610
flow . freeScopedLocals ( ) ;
2611
2611
outerFlow . popBreakLabel ( ) ;
@@ -3344,10 +3344,10 @@ export class Compiler extends DiagnosticEmitter {
3344
3344
else flow . inheritBranch ( bodyFlow ) ;
3345
3345
3346
3346
// Detect if local flags are incompatible before and after looping, and
3347
- // if so recompile by unifying local flags between iterations.
3347
+ // if so recompile by unifying local flags between iterations. Note that
3348
+ // this may be necessary multiple times where locals depend on each other.
3348
3349
// Here: Only relevant if flow does not always break.
3349
3350
if ( ! breaks && Flow . hasIncompatibleLocalStates ( flowBefore , flow ) ) {
3350
- assert ( ! flowAfter ) ; // should work on the first attempt
3351
3351
flow . freeTempLocal ( tcond ) ;
3352
3352
outerFlow . popBreakLabel ( ) ;
3353
3353
this . currentFlow = outerFlow ;
0 commit comments