From f20fbb9726004a9003bbdc4021b2606abcd3bd41 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 5 Feb 2015 13:14:41 -0800 Subject: [PATCH] Remove what looks like copy/paste errors in the parser. --- src/compiler/parser.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 05b5ea55505..0b17d95ac2b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -876,7 +876,10 @@ module ts { var sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0); - sourceFile.pos = sourceFile.end = 0; + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + sourceFile.referenceDiagnostics = []; sourceFile.parseDiagnostics = []; sourceFile.bindDiagnostics = []; @@ -961,13 +964,6 @@ module ts { // attached to the EOF token. var parseErrorBeforeNextFinishedNode: boolean = false; - sourceFile.syntacticDiagnostics = undefined; - sourceFile.referenceDiagnostics = []; - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - // Create and prime the scanner before parsing the source elements. scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError); token = nextToken();