From 97954003cc87b664768918173e8d00f6df35e04f Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 21 Aug 2022 19:16:42 +0100 Subject: feat: `queueMicrotask()` error handling (#15522) Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158). --- runtime/js/99_main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/js/99_main.js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index cbc5c1b5b..b25022a08 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -76,7 +76,7 @@ delete Intl.v8BreakIterator; const errors = window.__bootstrap.errors.errors; const webidl = window.__bootstrap.webidl; const domException = window.__bootstrap.domException; - const { defineEventHandler } = window.__bootstrap.event; + const { defineEventHandler, reportException } = window.__bootstrap.event; const { deserializeJsMessageData, serializeJsMessageData } = window.__bootstrap.messagePort; @@ -243,6 +243,7 @@ delete Intl.v8BreakIterator; core.setMacrotaskCallback(timers.handleTimerMacrotask); core.setMacrotaskCallback(promiseRejectMacrotaskCallback); core.setWasmStreamingCallback(fetch.handleWasmStreaming); + core.setReportExceptionCallback(reportException); ops.op_set_format_exception_callback(formatException); version.setVersions( runtimeOptions.denoVersion, -- cgit v1.2.3