summaryrefslogtreecommitdiff
path: root/lib/internal/bootstrap
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2019-05-18 22:48:46 -0500
committerGus Caplan <me@gus.host>2019-05-26 13:04:29 -0500
commite2c0c0c68074c539ae2ae30debdeafb9f94d989b (patch)
tree4b1748c744aa778f688804258c432cd5986cba64 /lib/internal/bootstrap
parent73c16b11e006256c2d41e70e964a4960ba435759 (diff)
downloadandroid-node-v8-e2c0c0c68074c539ae2ae30debdeafb9f94d989b.tar.gz
android-node-v8-e2c0c0c68074c539ae2ae30debdeafb9f94d989b.tar.bz2
android-node-v8-e2c0c0c68074c539ae2ae30debdeafb9f94d989b.zip
lib: rework logic of stripping BOM+Shebang from commonjs
Fixes https://github.com/nodejs/node/issues/27767 PR-URL: https://github.com/nodejs/node/pull/27768 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/internal/bootstrap')
-rw-r--r--lib/internal/bootstrap/pre_execution.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 24d25158f9..ed5a5afe4b 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -338,7 +338,7 @@ function initializePolicy() {
}
function initializeCJSLoader() {
- require('internal/modules/cjs/loader')._initPaths();
+ require('internal/modules/cjs/loader').Module._initPaths();
}
function initializeESMLoader() {
@@ -387,7 +387,9 @@ function loadPreloadModules() {
const preloadModules = getOptionValue('--require');
if (preloadModules) {
const {
- _preloadModules
+ Module: {
+ _preloadModules
+ },
} = require('internal/modules/cjs/loader');
_preloadModules(preloadModules);
}