diff options
author | Steven Scott <Contact@TheDgtl.net> | 2018-10-12 10:00:21 -0700 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-10-15 12:00:00 +0200 |
commit | 039965085dc24c4c47fb6816d4cf23ed915558f9 (patch) | |
tree | 5252ecbd05dd3debc0fec8ddff3f23f473fc591a /lib | |
parent | b2e133aeb7913bfbad15651f86d716425765f280 (diff) | |
download | android-node-v8-039965085dc24c4c47fb6816d4cf23ed915558f9.tar.gz android-node-v8-039965085dc24c4c47fb6816d4cf23ed915558f9.tar.bz2 android-node-v8-039965085dc24c4c47fb6816d4cf23ed915558f9.zip |
lib: switch to internalBinding for cjs loader
Switch the cjs loader to use internalBinding instead of
process.binding for reading command line options.
PR-URL: https://github.com/nodejs/node/pull/23492
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/modules/cjs/loader.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 2d5ed2189d..975c688eda 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -41,9 +41,10 @@ const { stripBOM, stripShebang } = require('internal/modules/cjs/helpers'); -const preserveSymlinks = !!process.binding('config').preserveSymlinks; -const preserveSymlinksMain = !!process.binding('config').preserveSymlinksMain; -const experimentalModules = !!process.binding('config').experimentalModules; +const options = internalBinding('options'); +const preserveSymlinks = options.getOptions('--preserve-symlinks'); +const preserveSymlinksMain = options.getOptions('--preserve-symlinks-main'); +const experimentalModules = options.getOptions('--experimental-modules'); const { ERR_INVALID_ARG_TYPE, |