-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib: switch to internalBinding for cjs loader #23492
Conversation
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options.
lib/internal/modules/cjs/loader.js
Outdated
const preserveSymlinksMain = !!process.binding('config').preserveSymlinksMain; | ||
const experimentalModules = !!process.binding('config').experimentalModules; | ||
const options = internalBinding('options'); | ||
const preserveSymlinks = !!options.getOptions('--preserve-symlinks'); |
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.
there's no need for the !!
here, as options.getOptions
already returns true/false
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.
I've removed the !!
in a second commit. I wasn't sure whether I should or not, as they were there for the old code. Thanks!
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: nodejs#23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: nodejs#23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: #23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: #23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: #23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: #23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of process.binding for reading command line options. PR-URL: #23492 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Switch the cjs loader to use internalBinding instead of
process.binding for reading command line options.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes