forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: make sure pass the
argv
to worker threads
PR-URL: nodejs#52827 Fixes: nodejs#52825 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
- Loading branch information
1 parent
f55bcea
commit ec14ab5
Showing
2 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Flags: --expose-internals | ||
'use strict'; | ||
require('../common'); | ||
const { Worker } = require('worker_threads'); | ||
|
||
const CODE = ` | ||
// If the --expose-internals flag does not pass to worker | ||
// require function will throw an error | ||
require('internal/options'); | ||
`; | ||
// Test if the flags is passed to worker threads | ||
// See https://github.com/nodejs/node/issues/52825 | ||
new Worker(CODE, { eval: true }); | ||
new Worker(CODE, { eval: true, env: process.env, execArgv: ['--expose-internals'] }); | ||
new Worker(CODE, { eval: true, env: process.env }); | ||
new Worker(CODE, { eval: true, execArgv: ['--expose-internals'] }); |