Speed up tests by not type-checking lib.d.ts unless the test asks for that.

This commit is contained in:
Cyrus Najmabadi
2015-06-04 01:03:02 -07:00
parent 343a923a35
commit 2bf19e80c3
25 changed files with 139 additions and 106 deletions

View File

@@ -11368,6 +11368,12 @@ module ts {
function checkSourceFileWorker(node: SourceFile) {
let links = getNodeLinks(node);
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
links.flags |= NodeCheckFlags.TypeChecked;
if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) {
return;
}
// Grammar checking
checkGrammarSourceFile(node);
@@ -11399,8 +11405,6 @@ module ts {
if (emitParam) {
links.flags |= NodeCheckFlags.EmitParam;
}
links.flags |= NodeCheckFlags.TypeChecked;
}
}

View File

@@ -391,6 +391,7 @@ module ts {
processImportedModules(file, basePath);
}
if (isDefaultLib) {
file.isDefaultLib = true;
files.unshift(file);
}
else {

View File

@@ -1143,7 +1143,8 @@ module ts {
// The first node that causes this file to be an external module
/* @internal */ externalModuleIndicator: Node;
/* @internal */ isDefaultLib: boolean;
/* @internal */ identifiers: Map<string>;
/* @internal */ nodeCount: number;
/* @internal */ identifierCount: number;
@@ -1823,6 +1824,7 @@ module ts {
experimentalDecorators?: boolean;
emitDecoratorMetadata?: boolean;
/* @internal */ stripInternal?: boolean;
/* @internal */ skipDefaultLibCheck?: boolean;
[option: string]: string | number | boolean;
}