Skip to content

Commit 1143ea8

Browse files
madeinjamjasnell
authored andcommitted
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: #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>
1 parent 2d2388d commit 1143ea8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/vm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ module.exports = {
415415
compileFunction,
416416
};
417417

418-
if (process.binding('config').experimentalVMModules) {
418+
if (internalBinding('options').getOptions('--experimental-vm-modules')) {
419419
const { SourceTextModule } = require('internal/vm/source_text_module');
420420
module.exports.SourceTextModule = SourceTextModule;
421421
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Flags: --expose-internals
2+
'use strict';
3+
4+
const common = require('../common');
5+
6+
// This is to ensure that the sendInspectorCommand function calls the error
7+
// function if its called with the v8_enable_inspector is disabled
8+
9+
process.config.variables.v8_enable_inspector = 0;
10+
const inspector = require('internal/util/inspector');
11+
12+
inspector.sendInspectorCommand(
13+
common.mustNotCall('Inspector callback should not be called'),
14+
common.mustCall(1),
15+
);

0 commit comments

Comments
 (0)