From 589c6a5ee730bd56b4a263609b47896a9a5a06e3 Mon Sep 17 00:00:00 2001 From: Igor Klopov Date: Wed, 8 May 2019 23:36:05 +0300 Subject: [PATCH] bootstrap.js: don't check PKG_DUMMY_ENTRYPOINT in worker threads --- prelude/bootstrap.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/prelude/bootstrap.js b/prelude/bootstrap.js index aa89854a7..99b365edd 100644 --- a/prelude/bootstrap.js +++ b/prelude/bootstrap.js @@ -45,10 +45,12 @@ if (process.env.PKG_EXECPATH === 'PKG_INVOKE_NODEJS') { return { undoPatch: true }; } -if (process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') { - // expand once patchless is introduced, that - // will obviously lack any work in node_main.cc - throw new Error('PKG_DUMMY_ENTRYPOINT EXPECTED'); +if (NODE_VERSION_MAJOR < 12 || require('worker_threads').isMainThread) { + if (process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') { + // expand once patchless is introduced, that + // will obviously lack any work in node_main.cc + throw new Error('PKG_DUMMY_ENTRYPOINT EXPECTED'); + } } if (process.env.PKG_EXECPATH === EXECPATH) {