From a4f30ff2a73ea1c0c3b77cf2648b3c24827190ee Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Fri, 1 Apr 2016 21:26:39 -0700 Subject: [PATCH] removed unused type assertions in harness --- src/compiler/program.ts | 2 +- src/harness/harness.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 09b42bb9f54..dbcf94cc8f0 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -12,7 +12,7 @@ namespace ts { const emptyArray: any[] = []; - const defaultLibrarySearchPaths = [ + const defaultLibrarySearchPaths = [ "types/", "node_modules/", "node_modules/@types/", diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 2c428082c40..d602b5dc2a8 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -856,8 +856,6 @@ namespace Harness { // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames const getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - const harnessNormalizePath = (f: string) => ts.normalizePath(getCanonicalFileName(f)); - const fileMap: ts.FileMap = ts.createFileMap(); for (const file of inputFiles) { if (file.content !== undefined) { @@ -865,7 +863,6 @@ namespace Harness { const sourceFile = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget); const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName); fileMap.set(path, sourceFile); - fileMap.set(harnessNormalizePath(path), sourceFile); } } @@ -902,10 +899,10 @@ namespace Harness { useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getNewLine: () => newLine, fileExists: fileName => { - return fileMap.contains(harnessNormalizePath(fileName)); + return fileMap.contains(ts.toPath(fileName, currentDirectory, getCanonicalFileName)); }, readFile: (fileName: string): string => { - return fileMap.get(harnessNormalizePath(fileName)).getText(); + return fileMap.get(ts.toPath(fileName, currentDirectory, getCanonicalFileName)).getText(); } }; } @@ -1493,7 +1490,7 @@ namespace Harness { baseDir = ts.getNormalizedAbsolutePath(baseDir, rootDir); } tsConfig = ts.parseJsonConfigFileContent(configJson.config, parseConfigHost, baseDir); - tsConfig.options.configFilePath = data.name; + tsConfig.options.configFilePath = data.name; // delete entry from the list testUnitData.splice(i, 1);