Skip to content

Commit f20fbb9

Browse files
Remove what looks like copy/paste errors in the parser.
1 parent c1dfdaa commit f20fbb9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/compiler/parser.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,10 @@ module ts {
876876

877877
var sourceFile = <SourceFile>createNode(SyntaxKind.SourceFile, /*pos*/ 0);
878878

879-
sourceFile.pos = sourceFile.end = 0;
879+
sourceFile.pos = 0;
880+
sourceFile.end = sourceText.length;
881+
sourceFile.text = sourceText;
882+
880883
sourceFile.referenceDiagnostics = [];
881884
sourceFile.parseDiagnostics = [];
882885
sourceFile.bindDiagnostics = [];
@@ -961,13 +964,6 @@ module ts {
961964
// attached to the EOF token.
962965
var parseErrorBeforeNextFinishedNode: boolean = false;
963966

964-
sourceFile.syntacticDiagnostics = undefined;
965-
sourceFile.referenceDiagnostics = [];
966-
sourceFile.parseDiagnostics = [];
967-
sourceFile.bindDiagnostics = [];
968-
sourceFile.end = sourceText.length;
969-
sourceFile.text = sourceText;
970-
971967
// Create and prime the scanner before parsing the source elements.
972968
scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError);
973969
token = nextToken();

0 commit comments

Comments
 (0)