Skip to content

Commit

Permalink
lib: switch to internalBinding for cjs loader
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
DrakiaXYZ authored and rvagg committed Nov 28, 2018
1 parent c886fa8 commit 3311d9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,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,
Expand Down

0 comments on commit 3311d9e

Please sign in to comment.