From 735efee7ce8a5cd594c6b2e647aaf11ae2ddbc51 Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 25 Aug 2015 16:47:02 -0700 Subject: [PATCH] Read default lib from the local file system instead of log-array when do Not use custom library file --- src/harness/harness.ts | 3 --- src/harness/rwcRunner.ts | 12 +++++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index de675948851..097340082e3 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1424,9 +1424,6 @@ module Harness { return diagnostic.file && diagnostic.file.fileName.indexOf("test262-harness") >= 0; }); - // Verify we didn't miss any errors in total - assert.equal(totalErrorsReported + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors"); - return minimalDiagnosticsToString(diagnostics) + Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n"); } diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index d8b52ec2e39..ea6f7b7ebb1 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -65,6 +65,15 @@ module RWC { opts.options.noEmitOnError = false; }); + if (!useCustomLibraryFile) { + let defaultLibPath = ts.sys.resolvePath("built/local/lib.d.ts"); + let defaultLib = { + unitName: ts.normalizePath(defaultLibPath), + content: Harness.IO.readFile(defaultLibPath) + }; + inputFiles.push(defaultLib); + } + runWithIOLog(ioLog, () => { harnessCompiler.reset(); @@ -96,9 +105,6 @@ module RWC { if (useCustomLibraryFile) { inputFiles.push(getHarnessCompilerInputUnit(fileRead.path)); } - else { - inputFiles.push(Harness.getDefaultLibraryFile()); - } } } }