diff --git a/packages/client-wasm/dist/snippets/browser-async-executor-b51ed65827bac93b/src/worker.js b/packages/client-wasm/dist/snippets/browser-async-executor-b51ed65827bac93b/src/worker.js index 43b583e..202e5f4 100644 --- a/packages/client-wasm/dist/snippets/browser-async-executor-b51ed65827bac93b/src/worker.js +++ b/packages/client-wasm/dist/snippets/browser-async-executor-b51ed65827bac93b/src/worker.js @@ -11,28 +11,33 @@ export function startWorker(e, o, t, r, s) { ); } -"WorkerGlobalScope" in self && - self instanceof WorkerGlobalScope && - (self.onmessage = async (e) => { - let [o, t, r, s] = e.data; - const a = - "function" == typeof __webpack_require__ - ? import("../../../index.js") - : import(s); - try { - const { default: e, worker_entry_point: s } = await a; - await e(o, t), - s(r), - postMessage("started"), - (self.onmessage = (e) => { - console.error("Unexpected message", e); - }); - } catch (e) { - throw ( - (setTimeout(() => { - throw e; - }), - e) - ); - } - }); +if ( + typeof WorkerGlobalScope !== "undefined" && + self instanceof WorkerGlobalScope +) { + "WorkerGlobalScope" in self && + self instanceof WorkerGlobalScope && + (self.onmessage = async (e) => { + let [o, t, r, s] = e.data; + const a = + "function" == typeof __webpack_require__ + ? import("../../../index.js") + : import(s); + try { + const { default: e, worker_entry_point: s } = await a; + await e(o, t), + s(r), + postMessage("started"), + (self.onmessage = (e) => { + console.error("Unexpected message", e); + }); + } catch (e) { + throw ( + (setTimeout(() => { + throw e; + }), + e) + ); + } + }); +}