From d37fdfe213a64105e7ce41797b202a7f81e9d878 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Mon, 9 Feb 2015 14:12:32 -0800 Subject: [PATCH] Add additional asserts. --- src/compiler/parser.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index d58a9f15105..3d512a88e56 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -508,6 +508,7 @@ module ts { return; function visitNode(child: IncrementalNode) { + Debug.assert(child.pos <= child.end); if (child.pos > changeRangeOldEnd) { // Node is entirely past the change range. We need to move both its pos and // end, forward or backward appropriately. @@ -531,9 +532,11 @@ module ts { } // Otherwise, the node is entirely before the change range. No need to do anything with it. + Debug.assert(fullEnd < changeStart); } function visitArray(array: IncrementalNodeArray) { + Debug.assert(array.pos <= array.end); if (array.pos > changeRangeOldEnd) { // Array is entirely after the change range. We need to move it, and move any of // its children.