summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Monge <jacjam@gmail.com>2018-10-12 09:41:57 -0700
committerRich Trott <rtrott@gmail.com>2018-10-13 14:49:42 -0700
commit9d1c9d7e9b9ae1ab201206fc85b7f553fb2bd6bb (patch)
tree3ed56cbad48a1399add353623444157154ba464c
parent401dac324c5e7b24d3e6663d29589b11562c5b12 (diff)
downloadandroid-node-v8-9d1c9d7e9b9ae1ab201206fc85b7f553fb2bd6bb.tar.gz
android-node-v8-9d1c9d7e9b9ae1ab201206fc85b7f553fb2bd6bb.tar.bz2
android-node-v8-9d1c9d7e9b9ae1ab201206fc85b7f553fb2bd6bb.zip
lib: migrate from process.binding to internalBinding
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: https://github.com/nodejs/node/pull/23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
-rw-r--r--lib/vm.js2
-rw-r--r--test/sequential/test-inspector-has-inspector-false.js15
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/vm.js b/lib/vm.js
index 869b4aa654..1bb948fa55 100644
--- a/lib/vm.js
+++ b/lib/vm.js
@@ -415,7 +415,7 @@ module.exports = {
compileFunction,
};
-if (process.binding('config').experimentalVMModules) {
+if (internalBinding('options').getOptions('--experimental-vm-modules')) {
const { SourceTextModule } = require('internal/vm/source_text_module');
module.exports.SourceTextModule = SourceTextModule;
}
diff --git a/test/sequential/test-inspector-has-inspector-false.js b/test/sequential/test-inspector-has-inspector-false.js
new file mode 100644
index 0000000000..cdb7ca9e19
--- /dev/null
+++ b/test/sequential/test-inspector-has-inspector-false.js
@@ -0,0 +1,15 @@
+// Flags: --expose-internals
+'use strict';
+
+const common = require('../common');
+
+// This is to ensure that the sendInspectorCommand function calls the error
+// function if its called with the v8_enable_inspector is disabled
+
+process.config.variables.v8_enable_inspector = 0;
+const inspector = require('internal/util/inspector');
+
+inspector.sendInspectorCommand(
+ common.mustNotCall('Inspector callback should not be called'),
+ common.mustCall(1),
+);