Skip to content

Commit d07cef7

Browse files
burgerboydaddyMylesBorins
authored andcommitted
lib: migrate from process.binding('config') to getOptions()
PR-URL: #23588 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent ace83a2 commit d07cef7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/internal/bootstrap/node.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,18 @@
120120
NativeModule.require('internal/inspector_async_hook').setup();
121121
}
122122

123-
const options = internalBinding('options');
124-
if (options.getOptions('--help')) {
123+
const { getOptions } = internalBinding('options');
124+
const helpOption = getOptions('--help');
125+
const completionBashOption = getOptions('--completion-bash');
126+
const experimentalModulesOption = getOptions('--experimental-modules');
127+
const experimentalVMModulesOption = getOptions('--experimental-vm-modules');
128+
const experimentalWorkerOption = getOptions('--experimental-worker');
129+
if (helpOption) {
125130
NativeModule.require('internal/print_help').print(process.stdout);
126131
return;
127132
}
128133

129-
if (options.getOptions('--completion-bash')) {
134+
if (completionBashOption) {
130135
NativeModule.require('internal/bash_completion').print(process.stdout);
131136
return;
132137
}
@@ -144,7 +149,7 @@
144149
setupGlobalURL();
145150
}
146151

147-
if (process.binding('config').experimentalWorker) {
152+
if (experimentalWorkerOption) {
148153
setupDOMException();
149154
}
150155

@@ -176,9 +181,8 @@
176181
'DeprecationWarning', 'DEP0062', startup, true);
177182
}
178183

179-
if (process.binding('config').experimentalModules ||
180-
process.binding('config').experimentalVMModules) {
181-
if (process.binding('config').experimentalModules) {
184+
if (experimentalModulesOption || experimentalVMModulesOption) {
185+
if (experimentalModulesOption) {
182186
process.emitWarning(
183187
'The ESM module loader is experimental.',
184188
'ExperimentalWarning', undefined);

0 commit comments

Comments
 (0)