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 1cda41b

Browse filesBrowse files
burgerboydaddytargos
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 09f25af commit 1cda41b
Copy full SHA for 1cda41b

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
@@ -112,13 +112,18 @@
112112
NativeModule.require('internal/inspector_async_hook').setup();
113113
}
114114

115-
const options = internalBinding('options');
116-
if (options.getOptions('--help')) {
115+
const { getOptions } = internalBinding('options');
116+
const helpOption = getOptions('--help');
117+
const completionBashOption = getOptions('--completion-bash');
118+
const experimentalModulesOption = getOptions('--experimental-modules');
119+
const experimentalVMModulesOption = getOptions('--experimental-vm-modules');
120+
const experimentalWorkerOption = getOptions('--experimental-worker');
121+
if (helpOption) {
117122
NativeModule.require('internal/print_help').print(process.stdout);
118123
return;
119124
}
120125

121-
if (options.getOptions('--completion-bash')) {
126+
if (completionBashOption) {
122127
NativeModule.require('internal/bash_completion').print(process.stdout);
123128
return;
124129
}
@@ -138,7 +143,7 @@
138143
setupQueueMicrotask();
139144
}
140145

141-
if (process.binding('config').experimentalWorker) {
146+
if (experimentalWorkerOption) {
142147
setupDOMException();
143148
}
144149

@@ -170,9 +175,8 @@
170175
'DeprecationWarning', 'DEP0062', startup, true);
171176
}
172177

173-
if (process.binding('config').experimentalModules ||
174-
process.binding('config').experimentalVMModules) {
175-
if (process.binding('config').experimentalModules) {
178+
if (experimentalModulesOption || experimentalVMModulesOption) {
179+
if (experimentalModulesOption) {
176180
process.emitWarning(
177181
'The ESM module loader is experimental.',
178182
'ExperimentalWarning', undefined);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.