From b354eaa2475a16f66e99efc82bebf5bd620406e4 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 1 Oct 2021 10:30:55 +0100 Subject: fix(runtime/js/workers): throw errors instead of using an op (#12249) --- runtime/js/11_workers.js | 10 +--------- runtime/js/99_main.js | 5 +---- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js index 2b908b9f8..59ae7371d 100644 --- a/runtime/js/11_workers.js +++ b/runtime/js/11_workers.js @@ -14,7 +14,6 @@ } = window.__bootstrap.primordials; const webidl = window.__bootstrap.webidl; const { URL } = window.__bootstrap.url; - const { Window } = window.__bootstrap.globalInterfaces; const { getLocationHref } = window.__bootstrap.location; const { log, pathFromURL } = window.__bootstrap.util; const { defineEventHandler } = window.__bootstrap.webUtil; @@ -265,14 +264,7 @@ } /* falls through */ case 2: { // Error if (!this.#handleError(data)) { - if (globalThis instanceof Window) { - throw new Error("Unhandled error event reached main worker."); - } else { - core.opSync( - "op_worker_unhandled_error", - data.message, - ); - } + throw new Error("Unhandled error event in child worker."); } break; } diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 9bbc06971..152430a76 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -157,10 +157,7 @@ delete Object.prototype.__proto__; globalDispatchEvent(errorEvent); if (!errorEvent.defaultPrevented) { - core.opSync( - "op_worker_unhandled_error", - e.message, - ); + throw e; } } } -- cgit v1.2.3