From 58fd8b8d925152c364948e4450da9d3797c5778a Mon Sep 17 00:00:00 2001 From: Ethan Halsall Date: Thu, 1 Jun 2023 22:06:22 -0500 Subject: [PATCH] fix: allow for nesting workers --- node.js | 1 + 1 file changed, 1 insertion(+) diff --git a/node.js b/node.js index 9d88718..644a05b 100644 --- a/node.js +++ b/node.js @@ -133,6 +133,7 @@ function mainThread() { function workerThread() { let { mod, name, type } = threads.workerData; + if (!mod) return mainThread(); // turn global into a mock WorkerGlobalScope const self = global.self = global;