From cd84d2a85a0a1c373d33f18f2e29f3fd26f28482 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 1 Jun 2017 19:05:07 -0700 Subject: [PATCH] Use emptyArray, rather than [] --- src/compiler/program.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index e9273daea2a..834122b3584 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1071,8 +1071,8 @@ namespace ts { Debug.assert(!!sourceFile.bindDiagnostics); // For JavaScript files, we don't want to report semantic errors unless explicitly requested. const includeBindAndCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options); - const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : []; - const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : []; + const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray; + const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray; const fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName); const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);