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>
This commit is contained in:
Andres Monge authored and Myles Borins committed 2018-11-29 11:38:30 -05:00
1 parent 6f01a792c8
commit cb597f231a
2 files changed
+16 -1

No files matched your search

+1 -1
View File
@@ -402,7 +402,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;
}
@@ -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),
);