Skip to content

Commit d37fdfe

Browse files
Add additional asserts.
1 parent 318aa8c commit d37fdfe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/parser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ module ts {
508508
return;
509509

510510
function visitNode(child: IncrementalNode) {
511+
Debug.assert(child.pos <= child.end);
511512
if (child.pos > changeRangeOldEnd) {
512513
// Node is entirely past the change range. We need to move both its pos and
513514
// end, forward or backward appropriately.
@@ -531,9 +532,11 @@ module ts {
531532
}
532533

533534
// Otherwise, the node is entirely before the change range. No need to do anything with it.
535+
Debug.assert(fullEnd < changeStart);
534536
}
535537

536538
function visitArray(array: IncrementalNodeArray) {
539+
Debug.assert(array.pos <= array.end);
537540
if (array.pos > changeRangeOldEnd) {
538541
// Array is entirely after the change range. We need to move it, and move any of
539542
// its children.

0 commit comments

Comments
 (0)