Skip to content

Commit dd3277c

Browse files
committed
PR feedback
1 parent 1c2f255 commit dd3277c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/testRunner/unittests/reuseProgramStructure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ namespace ts {
119119
});
120120
const useCaseSensitiveFileNames = sys && sys.useCaseSensitiveFileNames;
121121
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
122-
const filesByPath = useGetSourceFileByPath ? mapEntries(files, (fileName, file) => [toPath(fileName, "", getCanonicalFileName), file]) : undefined;
123122
const trace: string[] = [];
124123
const result: TestCompilerHost = {
125124
trace: s => trace.push(s),
@@ -139,7 +138,8 @@ namespace ts {
139138
},
140139
};
141140
if (useGetSourceFileByPath) {
142-
result.getSourceFileByPath = (_fileName, path) => filesByPath!.get(path);
141+
const filesByPath = mapEntries(files, (fileName, file) => [toPath(fileName, "", getCanonicalFileName), file]);
142+
result.getSourceFileByPath = (_fileName, path) => filesByPath.get(path);
143143
}
144144
return result;
145145
}

0 commit comments

Comments
 (0)