Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ensure error function call on inspector disabled #23586

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vm.js
Expand Up @@ -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 changes: 15 additions & 0 deletions test/sequential/test-inspector-has-inspector-false.js
@@ -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),
);