-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Migrating from process.binding('config') to getOptions() #23588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,7 +137,7 @@ | |
| setupQueueMicrotask(); | ||
| } | ||
|
|
||
| if (process.binding('config').experimentalWorker) { | ||
| if (internalBinding('options').getOptions('--experimental-worker')) { | ||
| setupDOMException(); | ||
| } | ||
|
|
||
|
|
@@ -169,9 +169,9 @@ | |
| 'DeprecationWarning', 'DEP0062', startup, true); | ||
| } | ||
|
|
||
| if (process.binding('config').experimentalModules || | ||
| process.binding('config').experimentalVMModules) { | ||
| if (process.binding('config').experimentalModules) { | ||
| if (internalBinding('options').getOptions('--experimental-modules') || | ||
| internalBinding('options').getOptions('--experimental-vm-modules')) { | ||
| if (internalBinding('options').getOptions('--experimental-modules')) { | ||
| process.emitWarning( | ||
| 'The ESM module loader is experimental.', | ||
| 'ExperimentalWarning', undefined); | ||
|
|
@@ -183,7 +183,7 @@ | |
| { | ||
| // Install legacy getters on the `util` binding for typechecking. | ||
| // TODO(addaleax): Turn into a full runtime deprecation. | ||
| const { pendingDeprecation } = process.binding('config'); | ||
| const { pendingDeprecation } = internalBinding('options').getOptions(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @burgerboydaddy I think something went wrong with this one?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @addaleax initial request was to replace process.binding('config') to thanks |
||
| const utilBinding = internalBinding('util'); | ||
| const types = internalBinding('types'); | ||
| for (const name of [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you factor out the
internalBindinginto a single call up top and also save the flag calls as variables to be used later?something like
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will do that.
But one question. There is already some similar code in place, like line 114:
Should I redo that part also and change code to use as mentioned:
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in my previous comment, will code like this (replacing line 114) be Ok:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@burgerboydaddy Yes, that definitely looks okay :)