mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
21 lines
392 B
JavaScript
21 lines
392 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const { Worker, isMainThread } = require('worker_threads')
|
||
|
|
||
|
// Tests that valid per-isolate/env NODE_OPTIONS are allowed and
|
||
|
// work in child workers.
|
||
|
if (isMainThread) {
|
||
|
new Worker(__filename, {
|
||
|
env: {
|
||
|
...process.env,
|
||
|
NODE_OPTIONS: '--trace-exit'
|
||
|
}
|
||
|
})
|
||
|
} else {
|
||
|
setImmediate(() => {
|
||
|
process.nextTick(() => {
|
||
|
process.exit(0);
|
||
|
});
|
||
|
});
|
||
|
}
|