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:
parent
401dac324c
commit
9d1c9d7e9b
@ -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;
|
||||
}
|
||||
|
15
test/sequential/test-inspector-has-inspector-false.js
Normal file
15
test/sequential/test-inspector-has-inspector-false.js
Normal file
@ -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),
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user