From e0900434c9ae74e35cee7e3ebe03b2e0cdb4ce41 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 24 Feb 2016 14:30:21 -0800 Subject: [PATCH] address PR feedback: add comments --- src/compiler/program.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 85d2e51985a..b051c0f5bcc 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -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); }