Skip to content

Commit d0aa789

Browse files
Add additional incremental assert.
1 parent 9d6b6b4 commit d0aa789

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/parser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ module ts {
580580
// start of the tree.
581581
for (var i = 0; start > 0 && i <= maxLookahead; i++) {
582582
var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start);
583+
Debug.assert(nearestNode.pos <= start);
583584
var position = nearestNode.pos;
584585

585586
start = Math.max(0, position - 1);
@@ -936,7 +937,6 @@ module ts {
936937
var identifiers: Map<string> = {};
937938
var identifierCount = 0;
938939
var nodeCount = 0;
939-
var scanner: Scanner;
940940
var token: SyntaxKind;
941941

942942
var sourceFile = <SourceFile>createNode(SyntaxKind.SourceFile, /*pos*/ 0);
@@ -1029,7 +1029,7 @@ module ts {
10291029
var parseErrorBeforeNextFinishedNode: boolean = false;
10301030

10311031
// Create and prime the scanner before parsing the source elements.
1032-
scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError);
1032+
var scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError);
10331033
token = nextToken();
10341034

10351035
processReferenceComments(sourceFile);

0 commit comments

Comments
 (0)