Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c601fde

Browse filesBrowse 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 e711e45 commit c601fde
Copy full SHA for c601fde

File tree

Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+11-7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.