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).
This commit is contained in:
Nayeem Rahman 2022-08-21 19:16:42 +01:00 committed by GitHub
parent e96933bc16
commit 97954003cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 91 additions and 4 deletions

View file

@ -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,