mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-28 09:22:42 -05:00
fix: CompilerHost.getSourceFile is being called for odd filenames besides the one being compiled
Ignore falsy file names from `getDefaultLibraryFileName` Closes: #13629
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