From 9575b3c3ca06935ab22e36d9d1dfb04b6c133bc4 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 1 Jun 2016 11:44:12 -0700 Subject: [PATCH] Revert to old tryLoad implementation --- src/compiler/program.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index dd3102410e..0c060807b1 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -643,15 +643,13 @@ namespace ts { onlyRecordFailures = !directoryProbablyExists(directory, state.host); } } + return forEach(extensions, tryLoad); - return forEach(extensions, ext => { + function tryLoad(ext: string): string { if (state.skipTsx && (ext === ".jsx" || ext === ".tsx")) { - return; + return undefined; } - return tryLoad(fileExtensionIs(candidate, ext) ? candidate : candidate + ext); - }); - - function tryLoad(fileName: string): string { + const fileName = fileExtensionIs(candidate, ext) ? candidate : candidate + ext; if (!onlyRecordFailures && state.host.fileExists(fileName)) { if (state.traceEnabled) { trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);