Use no-default-lib for the '--noLibCheck' flag.

This commit is contained in:
Daniel Rosenwasser 2015-04-29 17:42:28 -07:00
parent 8d99ecfa6c
commit eb15bb3658
2 changed files with 12 additions and 2 deletions

View File

@ -10934,10 +10934,12 @@ module ts {
function checkSourceFile(node: SourceFile) {
let start = new Date().getTime();
let skipCheck = node.fileName.indexOf("lib.d.ts") >= 0 && compilerOptions.noLibCheck;
let skipCheck = node.hasNoDefaultLib && compilerOptions.noLibCheck;
if (!skipCheck) {
checkSourceFileWorker(node);
}
checkTime += new Date().getTime() - start;
}

View File

@ -1004,6 +1004,14 @@ module ts {
amdModuleName: string;
referencedFiles: FileReference[];
/**
* lib.d.ts should have a reference comment like
*
* /// <reference no-default-lib="true"/>
*
* which serves the purpose of ignoring the file in certain ways in the
* presence of compiler options like '--noLib' and '--noLibCheck'.
*/
hasNoDefaultLib: boolean;
languageVersion: ScriptTarget;
@ -1042,7 +1050,7 @@ module ts {
(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
}
export interface Program extends ScriptReferenceHost {
export interface Program extends ScriptReferenceHost, TypeCheckerHost {
/**
* Get a list of files in the program
*/