Skip to content

Commit 26f356f

Browse files
madeinjamMylesBorins
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 <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 6acc891 commit 26f356f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/vm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ module.exports = {
402402
compileFunction,
403403
};
404404

405-
if (process.binding('config').experimentalVMModules) {
405+
if (internalBinding('options').getOptions('--experimental-vm-modules')) {
406406
const { SourceTextModule } = require('internal/vm/source_text_module');
407407
module.exports.SourceTextModule = SourceTextModule;
408408
}
Lines changed: 15 additions & 0 deletions
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)