diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9126bc465bd..3d7d980706b 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1410,9 +1410,16 @@ namespace ts { } function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void { - Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); + if (labelStack.length !== implicitLabelIndex + 1) { + Debug.assert(false, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`); + } + let i = implicitLabels.pop(); - Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`); + + if (implicitLabelIndex !== i) { + Debug.assert(false, `i: ${i}, index: ${implicitLabelIndex}`); + } + setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined); }