Skip to content

Commit 7d09f26

Browse files
committed
defer allocation of error message text in binder
1 parent 2779352 commit 7d09f26

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/compiler/binder.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,16 @@ namespace ts {
14101410
}
14111411

14121412
function popImplicitLabel(implicitLabelIndex: number, outerState: Reachability): void {
1413-
Debug.assert(labelStack.length === implicitLabelIndex + 1, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`);
1413+
if (labelStack.length !== implicitLabelIndex + 1) {
1414+
Debug.assert(false, `Label stack: ${labelStack.length}, index:${implicitLabelIndex}`);
1415+
}
1416+
14141417
let i = implicitLabels.pop();
1415-
Debug.assert(implicitLabelIndex === i, `i: ${i}, index: ${implicitLabelIndex}`);
1418+
1419+
if (implicitLabelIndex !== i) {
1420+
Debug.assert(false, `i: ${i}, index: ${implicitLabelIndex}`);
1421+
}
1422+
14161423
setCurrentStateAtLabel(labelStack.pop(), outerState, /*name*/ undefined);
14171424
}
14181425

0 commit comments

Comments
 (0)