mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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:
1 parent
6f01a792c8
commit
cb597f231a
2 files changed
+16
-1
No files matched your search
@@ -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),
|
||||
);
|
||||
Reference in new issue
Block a user