PR feedback

This commit is contained in:
Sheetal Nandi 2018-10-01 12:12:22 -07:00
parent 1c2f2555ec
commit dd3277c219

View file

@ -119,7 +119,6 @@ namespace ts {
});
const useCaseSensitiveFileNames = sys && sys.useCaseSensitiveFileNames;
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
const filesByPath = useGetSourceFileByPath ? mapEntries(files, (fileName, file) => [toPath(fileName, "", getCanonicalFileName), file]) : undefined;
const trace: string[] = [];
const result: TestCompilerHost = {
trace: s => trace.push(s),
@ -139,7 +138,8 @@ namespace ts {
},
};
if (useGetSourceFileByPath) {
result.getSourceFileByPath = (_fileName, path) => filesByPath!.get(path);
const filesByPath = mapEntries(files, (fileName, file) => [toPath(fileName, "", getCanonicalFileName), file]);
result.getSourceFileByPath = (_fileName, path) => filesByPath.get(path);
}
return result;
}