mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-14 16:56:06 -05:00
Fix incorrect lib condition again! (#58945)
This commit is contained in:
@@ -2777,7 +2777,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!options.noLib) {
|
||||
if (options.noLib) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2788,7 +2788,11 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
|
||||
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
||||
}
|
||||
else {
|
||||
return some(options.lib, libFileName => equalityComparer(file.fileName, resolvedLibReferences!.get(libFileName)!.actual));
|
||||
return some(options.lib, libFileName => {
|
||||
// We might not have resolved lib if one of the root file included contained no-default-lib = true
|
||||
const resolvedLib = resolvedLibReferences!.get(libFileName);
|
||||
return !!resolvedLib && equalityComparer(file.fileName, resolvedLib.actual);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user