From 540c01af28e57c9f0c84e7092c0063c44e03e2e9 Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Fri, 12 Oct 2018 10:00:21 -0700 Subject: [PATCH] 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 Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- lib/internal/modules/cjs/loader.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 2d5ed2189d467c..975c688edab3d7 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,