Skip to content

Commit

Permalink
lib: migrate from process.binding('config') to getOptions()
Browse files Browse the repository at this point in the history
PR-URL: nodejs#23588
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
burgerboydaddy authored and Trott committed Oct 24, 2018
1 parent cdba3c1 commit bb79e76
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,18 @@
NativeModule.require('internal/inspector_async_hook').setup();
}

const options = internalBinding('options');
if (options.getOptions('--help')) {
const { getOptions } = internalBinding('options');
const helpOption = getOptions('--help');
const completionBashOption = getOptions('--completion-bash');
const experimentalModulesOption = getOptions('--experimental-modules');
const experimentalVMModulesOption = getOptions('--experimental-vm-modules');
const experimentalWorkerOption = getOptions('--experimental-worker');
if (helpOption) {
NativeModule.require('internal/print_help').print(process.stdout);
return;
}

if (options.getOptions('--completion-bash')) {
if (completionBashOption) {
NativeModule.require('internal/bash_completion').print(process.stdout);
return;
}
Expand All @@ -138,7 +143,7 @@
setupQueueMicrotask();
}

if (process.binding('config').experimentalWorker) {
if (experimentalWorkerOption) {
setupDOMException();
}

Expand Down Expand Up @@ -170,9 +175,8 @@
'DeprecationWarning', 'DEP0062', startup, true);
}

if (process.binding('config').experimentalModules ||
process.binding('config').experimentalVMModules) {
if (process.binding('config').experimentalModules) {
if (experimentalModulesOption || experimentalVMModulesOption) {
if (experimentalModulesOption) {
process.emitWarning(
'The ESM module loader is experimental.',
'ExperimentalWarning', undefined);
Expand Down

0 comments on commit bb79e76

Please sign in to comment.