diff --git a/patches/node.v18.15.0.cpp.patch b/patches/node.v18.15.0.cpp.patch index 4cbd4ac5..4faf0829 100644 --- a/patches/node.v18.15.0.cpp.patch +++ b/patches/node.v18.15.0.cpp.patch @@ -186,14 +186,19 @@ new file mode 100644 index 0000000000..e97e9e524c --- /dev/null +++ node/lib/internal/bootstrap/pkg.js -@@ -0,0 +1,44 @@ +@@ -0,0 +1,49 @@ +'use strict'; + +const { ++ prepareWorkerThreadExecution, + prepareMainThreadExecution +} = require('internal/process/pre_execution'); + -+prepareMainThreadExecution(true); ++if (internalBinding('worker').isMainThread) { ++ prepareMainThreadExecution(true); ++} else { ++ prepareWorkerThreadExecution(); ++} + +(function () { + var __require__ = require; diff --git a/patches/node.v19.8.1.cpp.patch b/patches/node.v19.8.1.cpp.patch index fd0855b0..a7afe22e 100644 --- a/patches/node.v19.8.1.cpp.patch +++ b/patches/node.v19.8.1.cpp.patch @@ -186,14 +186,19 @@ new file mode 100644 index 0000000000..e97e9e524c --- /dev/null +++ node/lib/internal/bootstrap/pkg.js -@@ -0,0 +1,44 @@ +@@ -0,0 +1,49 @@ +'use strict'; + +const { ++ prepareWorkerThreadExecution, + prepareMainThreadExecution +} = require('internal/process/pre_execution'); + -+prepareMainThreadExecution(true); ++if (internalBinding('worker').isMainThread) { ++ prepareMainThreadExecution(true); ++} else { ++ prepareWorkerThreadExecution(); ++} + +(function () { + var __require__ = require;