Files
bun.sh/test/js/node/worker_threads/fixture-execargv.js
190n eee5d4fb4a node:worker_threads low-hanging fruit (#18758)
Co-authored-by: 190n <7763597+190n@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
Co-authored-by: chloe caruso <git@paperclover.net>
2025-04-08 05:29:53 -07:00

14 lines
398 B
JavaScript

import assert from "node:assert";
import { Worker } from "node:worker_threads";
// parent thread needs to have nonempty execArgv, otherwise the test is faulty
assert(process.execArgv.length > 0);
const execArgvToPass = JSON.parse(process.argv[2]);
new Worker("console.log(JSON.stringify(process.execArgv));", { eval: true, execArgv: execArgvToPass }).on(
"error",
e => {
throw e;
},
);