Skip to content

Commit a4f30ff

Browse files
committed
removed unused type assertions in harness
1 parent 12d90f3 commit a4f30ff

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ts {
1212

1313
const emptyArray: any[] = [];
1414

15-
const defaultLibrarySearchPaths = <Path[]>[
15+
const defaultLibrarySearchPaths = [
1616
"types/",
1717
"node_modules/",
1818
"node_modules/@types/",

src/harness/harness.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -856,16 +856,13 @@ namespace Harness {
856856
// Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames
857857
const getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
858858

859-
const harnessNormalizePath = (f: string) => <ts.Path>ts.normalizePath(getCanonicalFileName(f));
860-
861859
const fileMap: ts.FileMap<ts.SourceFile> = ts.createFileMap<ts.SourceFile>();
862860
for (const file of inputFiles) {
863861
if (file.content !== undefined) {
864862
const fileName = ts.normalizePath(file.unitName);
865863
const sourceFile = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget);
866864
const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName);
867865
fileMap.set(path, sourceFile);
868-
fileMap.set(harnessNormalizePath(path), sourceFile);
869866
}
870867
}
871868

@@ -902,10 +899,10 @@ namespace Harness {
902899
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
903900
getNewLine: () => newLine,
904901
fileExists: fileName => {
905-
return fileMap.contains(harnessNormalizePath(fileName));
902+
return fileMap.contains(ts.toPath(fileName, currentDirectory, getCanonicalFileName));
906903
},
907904
readFile: (fileName: string): string => {
908-
return fileMap.get(harnessNormalizePath(fileName)).getText();
905+
return fileMap.get(ts.toPath(fileName, currentDirectory, getCanonicalFileName)).getText();
909906
}
910907
};
911908
}
@@ -1493,7 +1490,7 @@ namespace Harness {
14931490
baseDir = ts.getNormalizedAbsolutePath(baseDir, rootDir);
14941491
}
14951492
tsConfig = ts.parseJsonConfigFileContent(configJson.config, parseConfigHost, baseDir);
1496-
tsConfig.options.configFilePath = <ts.Path>data.name;
1493+
tsConfig.options.configFilePath = data.name;
14971494

14981495
// delete entry from the list
14991496
testUnitData.splice(i, 1);

0 commit comments

Comments
 (0)