address PR feedback: add comments

This commit is contained in:
Vladimir Matveev
2016-02-24 14:30:21 -08:00
parent 8e77f40ace
commit e0900434c9

View File

@@ -1031,6 +1031,7 @@ namespace ts {
function getDeclarationDiagnostics(sourceFile: SourceFile, cancellationToken: CancellationToken): Diagnostic[] {
const options = program.getCompilerOptions();
// collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit)
if (!sourceFile || options.out || options.outFile) {
return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
}