mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #23043 from alan-agius4/feature/compiler-host-falsy-file
fix: `CompilerHost.getSourceFile` is being called for odd filenames
This commit is contained in:
@@ -611,8 +611,9 @@ namespace ts {
|
||||
if (!skipDefaultLib) {
|
||||
// If '--lib' is not specified, include default library file according to '--target'
|
||||
// otherwise, using options specified in '--lib' instead of '--target' default library file
|
||||
if (!options.lib) {
|
||||
processRootFile(getDefaultLibraryFileName(), /*isDefaultLib*/ true);
|
||||
const defaultLibraryFileName = getDefaultLibraryFileName();
|
||||
if (!options.lib && defaultLibraryFileName) {
|
||||
processRootFile(defaultLibraryFileName, /*isDefaultLib*/ true);
|
||||
}
|
||||
else {
|
||||
forEach(options.lib, libFileName => {
|
||||
@@ -1117,7 +1118,7 @@ namespace ts {
|
||||
// otherwise, using options specified in '--lib' instead of '--target' default library file
|
||||
const equalityComparer = host.useCaseSensitiveFileNames() ? equateStringsCaseSensitive : equateStringsCaseInsensitive;
|
||||
if (!options.lib) {
|
||||
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
||||
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
||||
}
|
||||
else {
|
||||
return forEach(options.lib, libFileName => equalityComparer(file.fileName, combinePaths(defaultLibraryPath, libFileName)));
|
||||
|
||||
Reference in New Issue
Block a user