mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 08:06:27 +00:00

Fix spawning nested worker threads from preload scripts and warn about doing so. Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/36531 PR-URL: https://github.com/nodejs/node/pull/37481 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
11 lines
306 B
JavaScript
11 lines
306 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const worker = fixtures.path('worker-preload.js');
|
|
const { exec } = require('child_process');
|
|
const kNodeBinary = process.argv[0];
|
|
|
|
|
|
exec(`"${kNodeBinary}" -r "${worker}" -pe "1+1"`, common.mustSucceed());
|