Skip to content

Commit 9575b3c

Browse files
author
Andy Hanson
committed
Revert to old tryLoad implementation
1 parent 9179f4c commit 9575b3c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/compiler/program.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,15 +643,13 @@ namespace ts {
643643
onlyRecordFailures = !directoryProbablyExists(directory, state.host);
644644
}
645645
}
646+
return forEach(extensions, tryLoad);
646647

647-
return forEach(extensions, ext => {
648+
function tryLoad(ext: string): string {
648649
if (state.skipTsx && (ext === ".jsx" || ext === ".tsx")) {
649-
return;
650+
return undefined;
650651
}
651-
return tryLoad(fileExtensionIs(candidate, ext) ? candidate : candidate + ext);
652-
});
653-
654-
function tryLoad(fileName: string): string {
652+
const fileName = fileExtensionIs(candidate, ext) ? candidate : candidate + ext;
655653
if (!onlyRecordFailures && state.host.fileExists(fileName)) {
656654
if (state.traceEnabled) {
657655
trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);

0 commit comments

Comments
 (0)