summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/compiler.ts5
-rw-r--r--cli/js/compiler_api.ts4
-rw-r--r--cli/js/lib.deno_runtime.d.ts4
3 files changed, 7 insertions, 6 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index 76a0f7262..c0f9c0a1e 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -240,9 +240,10 @@ self.compilerMain = function compilerMain(): void {
emitResult.emitSkipped === false,
"Unexpected skip of the emit."
);
- const { items } = fromTypeScriptDiagnostic(diagnostics);
const result = [
- items && items.length ? items : undefined,
+ diagnostics.length
+ ? fromTypeScriptDiagnostic(diagnostics)
+ : undefined,
bundle ? state.emitBundle : state.emitMap
];
postMessage(result);
diff --git a/cli/js/compiler_api.ts b/cli/js/compiler_api.ts
index 077d19bdd..487807d66 100644
--- a/cli/js/compiler_api.ts
+++ b/cli/js/compiler_api.ts
@@ -328,7 +328,7 @@ export function compile(
rootName: string,
sources?: Record<string, string>,
options?: CompilerOptions
-): Promise<[Diagnostic[] | undefined, Record<string, string>]> {
+): Promise<[Diagnostic | undefined, Record<string, string>]> {
const payload = {
rootName: sources ? rootName : checkRelative(rootName),
sources,
@@ -377,7 +377,7 @@ export function bundle(
rootName: string,
sources?: Record<string, string>,
options?: CompilerOptions
-): Promise<[Diagnostic[] | undefined, string]> {
+): Promise<[Diagnostic | undefined, string]> {
const payload = {
rootName: sources ? rootName : checkRelative(rootName),
sources,
diff --git a/cli/js/lib.deno_runtime.d.ts b/cli/js/lib.deno_runtime.d.ts
index d45ad2540..8740af062 100644
--- a/cli/js/lib.deno_runtime.d.ts
+++ b/cli/js/lib.deno_runtime.d.ts
@@ -1904,7 +1904,7 @@ declare namespace Deno {
rootName: string,
sources?: Record<string, string>,
options?: CompilerOptions
- ): Promise<[Diagnostic[] | undefined, Record<string, string>]>;
+ ): Promise<[Diagnostic | undefined, Record<string, string>]>;
/** Takes a root module name, and optionally a record set of sources. Resolves
* with a single JavaScript string that is like the output of a `deno bundle`
@@ -1938,7 +1938,7 @@ declare namespace Deno {
rootName: string,
sources?: Record<string, string>,
options?: CompilerOptions
- ): Promise<[Diagnostic[] | undefined, string]>;
+ ): Promise<[Diagnostic | undefined, string]>;
// @url js/deno.d.ts