From 683e5f41f8e2d80dfc3dec9b728975b9782842a3 Mon Sep 17 00:00:00 2001 From: Ethan Halsall Date: Thu, 4 Jan 2024 12:57:29 -0600 Subject: [PATCH] fix: allow for nesting workers (#40) --- 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;