Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5f3f648

Browse files
madeinjamaddaleax
authored andcommittedOct 20, 2018
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 a01858d commit 5f3f648

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
@@ -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
}
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)
Please sign in to comment.