Skip to content

Commit 718a5d0

Browse files
committed
1 parent 722edc5 commit 718a5d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ export class Compiler extends DiagnosticEmitter {
397397

398398
/** Program reference. */
399399
program: Program;
400+
static breakingFlowAlternatives: Flow | null = null;
400401
/** Module instance being compiled. */
401402
get module(): Module { return this.program.module; }
402403
/** Provided options. */
@@ -2831,7 +2832,10 @@ export class Compiler extends DiagnosticEmitter {
28312832
// Combine all alternatives that merge again with outer flow
28322833
if (possiblyBreaks || (isLast && possiblyFallsThrough)) {
28332834
if (breakingFlowAlternatives) breakingFlowAlternatives.inheritAlternatives(breakingFlowAlternatives, innerFlow);
2834-
else breakingFlowAlternatives = innerFlow;
2835+
else {
2836+
breakingFlowAlternatives = innerFlow;
2837+
Compiler.breakingFlowAlternatives = breakingFlowAlternatives;
2838+
}
28352839

28362840
// Otherwise just merge the effects of a non-merging branch
28372841
} else if (!possiblyFallsThrough) {

0 commit comments

Comments
 (0)