From 7d09f268c40fb63b39d186718ddf2f5c804b9723 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 22 Oct 2015 09:50:38 -0700 Subject: [PATCH] defer allocation of error message text in binder --- src/compiler/binder.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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); }