Skip to content

Commit 540c01a

Browse files
DrakiaXYZjasnell
authored andcommitted
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: #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>
1 parent b041922 commit 540c01a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/internal/modules/cjs/loader.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ const {
4141
stripBOM,
4242
stripShebang
4343
} = require('internal/modules/cjs/helpers');
44-
const preserveSymlinks = !!process.binding('config').preserveSymlinks;
45-
const preserveSymlinksMain = !!process.binding('config').preserveSymlinksMain;
46-
const experimentalModules = !!process.binding('config').experimentalModules;
44+
const options = internalBinding('options');
45+
const preserveSymlinks = options.getOptions('--preserve-symlinks');
46+
const preserveSymlinksMain = options.getOptions('--preserve-symlinks-main');
47+
const experimentalModules = options.getOptions('--experimental-modules');
4748

4849
const {
4950
ERR_INVALID_ARG_TYPE,

0 commit comments

Comments
 (0)