Skip to content

Commit cd84d2a

Browse files
committed
Use emptyArray, rather than []
1 parent 01d6d48 commit cd84d2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/program.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,8 @@ namespace ts {
10711071
Debug.assert(!!sourceFile.bindDiagnostics);
10721072
// For JavaScript files, we don't want to report semantic errors unless explicitly requested.
10731073
const includeBindAndCheckDiagnostics = !isSourceFileJavaScript(sourceFile) || isCheckJsEnabledForFile(sourceFile, options);
1074-
const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : [];
1075-
const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : [];
1074+
const bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray;
1075+
const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray;
10761076
const fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
10771077
const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
10781078

0 commit comments

Comments
 (0)