From 2736b8cef0b0d5f4d215ca6d49fe64de8dc61356 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 3083cdbb8bce3f..4e48d549377081 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -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,