lib: migrate process.binding to getOptions
PR-URL: https://github.com/nodejs/node/pull/23522 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
495ced01fd
commit
101812e0a9
@ -9,6 +9,8 @@ const {
|
|||||||
CHAR_HASH,
|
CHAR_HASH,
|
||||||
} = require('internal/constants');
|
} = require('internal/constants');
|
||||||
|
|
||||||
|
const { getOptions } = internalBinding('options');
|
||||||
|
|
||||||
// Invoke with makeRequireFunction(module) where |module| is the Module object
|
// Invoke with makeRequireFunction(module) where |module| is the Module object
|
||||||
// to use as the context for the require() function.
|
// to use as the context for the require() function.
|
||||||
function makeRequireFunction(mod) {
|
function makeRequireFunction(mod) {
|
||||||
@ -105,7 +107,7 @@ const builtinLibs = [
|
|||||||
'v8', 'vm', 'zlib'
|
'v8', 'vm', 'zlib'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (process.binding('config').experimentalWorker) {
|
if (getOptions('--experimental-worker')) {
|
||||||
builtinLibs.push('worker_threads');
|
builtinLibs.push('worker_threads');
|
||||||
builtinLibs.sort();
|
builtinLibs.sort();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user