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

lib: refactor setupInspector in bootstrap/node.js #24446

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@

function setupGlobalConsole() {
const originalConsole = global.console;
const CJSModule = NativeModule.require('internal/modules/cjs/loader');
// Setup Node.js global.console.
const wrappedConsole = NativeModule.require('console');
Object.defineProperty(global, 'console', {
Expand All @@ -448,7 +447,7 @@
value: wrappedConsole,
writable: true
});
setupInspector(originalConsole, wrappedConsole, CJSModule);
setupInspector(originalConsole, wrappedConsole);
}

function setupGlobalURL() {
Expand Down Expand Up @@ -521,10 +520,11 @@
NativeModule.require('internal/domexception');
}

function setupInspector(originalConsole, wrappedConsole, CJSModule) {
function setupInspector(originalConsole, wrappedConsole) {
if (!process.config.variables.v8_enable_inspector) {
return;
}
const CJSModule = NativeModule.require('internal/modules/cjs/loader');
const { addCommandLineAPI, consoleCall } = process.binding('inspector');
// Setup inspector command line API.
const { makeRequireFunction } =
Expand Down