From 2818b2b6fd990a207d8447e1a54327232b1a11dc Mon Sep 17 00:00:00 2001 From: Dan Quirk Date: Tue, 14 Jul 2015 18:54:21 -0700 Subject: [PATCH] Minor fixes --- src/harness/harness.ts | 8 ++++---- src/harness/sourceMapRecorder.ts | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 54f9041c302..2ceeb1214a0 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -96,7 +96,7 @@ module Utils { path = "tests/" + path; } - let content = ''; + let content: string = undefined; try { content = ts.sys.readFile(Harness.userSpecifiedRoot + path); } @@ -812,12 +812,12 @@ module Harness { sourceText: string, languageVersion: ts.ScriptTarget) { // We'll only assert inletiants outside of light mode. - const shouldassertInvariants = !Harness.lightMode; + const shouldAssertInvariants = !Harness.lightMode; // Only set the parent nodes if we're asserting inletiants. We don't need them otherwise. - let result = ts.createSourceFile(fileName, sourceText, languageVersion, /*setParentNodes:*/ shouldassertInvariants); + let result = ts.createSourceFile(fileName, sourceText, languageVersion, /*setParentNodes:*/ shouldAssertInvariants); - if (shouldassertInvariants) { + if (shouldAssertInvariants) { Utils.assertInvariants(result, /*parent:*/ undefined); } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index cd5259c3df1..2e423eaa888 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -329,8 +329,6 @@ module Harness.SourceMapRecoder { } function writeRecordedSpans() { - let markerIds: string[] = []; - function getMarkerId(markerIndex: number) { let markerId = ""; if (spanMarkerContinues) { @@ -418,6 +416,7 @@ module Harness.SourceMapRecoder { writeJsFileLines(currentJsLine); // Emit markers + var markerIds: string[] = []; iterateSpans(writeSourceMapMarker); let jsFileText = getTextOfLine(currentJsLine, jsLineMap, jsFile.code);