summaryrefslogtreecommitdiff
path: root/cli/js/compiler.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-02-07 17:54:05 +1100
committerGitHub <noreply@github.com>2020-02-07 01:54:05 -0500
commitea6179f7dce89416f1586ee18c2f437e68eabd38 (patch)
tree79a9416098b407af26f0745068a1310988eac98e /cli/js/compiler.ts
parent5a8ba3b114bbacf10f03abc0335a753585861c97 (diff)
Improve support for diagnostics from runtime compiler APIs (#3911)
- Exports diagnostic items from `diagnostics.ts` which are missing at runtime. - Returns an array of diagnostics, instead of an object with a property of `items`. This is because of the way Rust deals with certain structures, and shouldn't be exposed in the APIs.
Diffstat (limited to 'cli/js/compiler.ts')
-rw-r--r--cli/js/compiler.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/js/compiler.ts b/cli/js/compiler.ts
index f003d7d0b..bf0287efe 100644
--- a/cli/js/compiler.ts
+++ b/cli/js/compiler.ts
@@ -255,7 +255,9 @@ async function tsCompilerOnMessage({
assert(emitResult.emitSkipped === false, "Unexpected skip of the emit.");
const result = [
- diagnostics.length ? fromTypeScriptDiagnostic(diagnostics) : undefined,
+ diagnostics.length
+ ? fromTypeScriptDiagnostic(diagnostics).items
+ : undefined,
bundle ? state.emitBundle : state.emitMap
];
globalThis.postMessage(result);