Baseline accept and reorder program logic so common source dir is right

This commit is contained in:
Ryan Cavanaugh
2016-05-18 11:30:40 -07:00
parent f0e3ebe37d
commit 58b11b631f
26 changed files with 328 additions and 111 deletions

View File

@@ -1019,6 +1019,8 @@ namespace ts {
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? createFileMap<SourceFile>(fileName => fileName.toLowerCase()) : undefined;
if (!tryReuseStructureFromOldProgram()) {
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
// load type declarations specified via 'types' argument
let typeReferences: string[];
if (options.types) {
@@ -1027,7 +1029,10 @@ namespace ts {
else {
// or load all types from the automatic type import fields
if (host.getDefaultTypeDirectiveNames) {
typeReferences = host.getDefaultTypeDirectiveNames(getCommonSourceDirectory());
const commonRoot = getCommonSourceDirectory();
if (commonRoot) {
typeReferences = host.getDefaultTypeDirectiveNames(commonRoot);
}
}
}
@@ -1038,7 +1043,6 @@ namespace ts {
}
}
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false));
// Do not process the default library if:
// - The '--noLib' flag is used.
// - A 'no-default-lib' reference comment is encountered in