summaryrefslogtreecommitdiff
path: root/lib/internal
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-01-13 01:01:27 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-01-16 21:54:23 +0800
commitcd70cbcbddfe1a577d5cf3f2c1c754359a04b9a2 (patch)
tree4646dde3afad5e4e981ecba9131d3f5819aa7425 /lib/internal
parent6b2af91a88b0a5e4d846701971065b8d668c8b1d (diff)
downloadandroid-node-v8-cd70cbcbddfe1a577d5cf3f2c1c754359a04b9a2.tar.gz
android-node-v8-cd70cbcbddfe1a577d5cf3f2c1c754359a04b9a2.tar.bz2
android-node-v8-cd70cbcbddfe1a577d5cf3f2c1c754359a04b9a2.zip
src: pass cli options to bootstrap/loaders.js lexically
Instead of using `internalBinding('config')` which should be used to carry information about build-time options, directly pass the run-time cli options into bootstrap/loaders.js lexically via function arguments. PR-URL: https://github.com/nodejs/node/pull/25463 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'lib/internal')
-rw-r--r--lib/internal/bootstrap/loaders.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
index 4554526298..6eed9eab26 100644
--- a/lib/internal/bootstrap/loaders.js
+++ b/lib/internal/bootstrap/loaders.js
@@ -42,7 +42,7 @@
// This file is compiled as if it's wrapped in a function with arguments
// passed by node::LoadEnvironment()
/* global process, getBinding, getLinkedBinding, getInternalBinding */
-/* global debugBreak */
+/* global debugBreak, experimentalModules, exposeInternals */
if (debugBreak)
debugger; // eslint-disable-line no-debugger
@@ -162,7 +162,6 @@ internalBinding('module_wrap').callbackMap = new WeakMap();
// written in CommonJS style.
const loaderExports = { internalBinding, NativeModule };
const loaderId = 'internal/bootstrap/loaders';
-const config = internalBinding('config');
// Set up NativeModule.
function NativeModule(id) {
@@ -177,7 +176,7 @@ function NativeModule(id) {
// Do not expose this to user land even with --expose-internals.
this.canBeRequiredByUsers = false;
} else if (id.startsWith('internal/')) {
- this.canBeRequiredByUsers = config.exposeInternals;
+ this.canBeRequiredByUsers = exposeInternals;
} else {
this.canBeRequiredByUsers = true;
}
@@ -316,7 +315,7 @@ NativeModule.prototype.compile = function() {
const fn = compileFunction(id);
fn(this.exports, requireFn, this, process, internalBinding);
- if (config.experimentalModules && this.canBeRequiredByUsers) {
+ if (experimentalModules && this.canBeRequiredByUsers) {
this.proxifyExports();
}