From 8b8a138bd0fd44c0c87a2615a1f57e0c7e6570b1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 31 Jul 2015 10:47:36 -0700 Subject: [PATCH] Use one call to 'reportDiagnostics'. --- src/compiler/tsc.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 4c9ec6beaff..880180b133e 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -359,20 +359,19 @@ namespace ts { // First get and report any syntactic errors. diagnostics = program.getSyntacticDiagnostics(); - reportDiagnostics(diagnostics); // If we didn't have any syntactic errors, then also try getting the global and // semantic errors. if (diagnostics.length === 0) { diagnostics = program.getGlobalDiagnostics(); - reportDiagnostics(diagnostics); if (diagnostics.length === 0) { diagnostics = program.getSemanticDiagnostics(); - reportDiagnostics(diagnostics); } } + reportDiagnostics(diagnostics); + // If the user doesn't want us to emit, then we're done at this point. if (compilerOptions.noEmit) { return diagnostics.length