Skip to content

Commit 90476ac

Browse files
committed
lib: remove _debugger.js
The file no longer works after the removal of the --debug/--debug-brk switches in commit 47f8f74 ("src: remove support for --debug".) This commit also removes several tests that still referenced the old debugger but were either unit-testing its internals or passing for the wrong reason (like expecting an operation to fail, which it did because the debugger is gone.) PR-URL: #12495 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e0b076a commit 90476ac

22 files changed

+14
-2515
lines changed

lib/_debugger.js

-1,791
This file was deleted.

lib/internal/bootstrap_node.js

+2-31
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@
122122

123123
const internalModule = NativeModule.require('internal/module');
124124
internalModule.addBuiltinLibsToObject(global);
125-
run(() => {
126-
evalScript('[eval]');
127-
});
125+
evalScript('[eval]');
128126
} else if (process.argv[1]) {
129127
// make process.argv[1] into a full path
130128
const path = NativeModule.require('path');
@@ -143,7 +141,7 @@
143141
}
144142

145143
preloadModules();
146-
run(Module.runMain);
144+
Module.runMain();
147145
} else {
148146
preloadModules();
149147
// If -i or --interactive were passed, or stdin is a TTY.
@@ -417,33 +415,6 @@
417415
}
418416
}
419417

420-
function isDebugBreak() {
421-
return process.execArgv.some((arg) => /^--debug-brk(=[0-9]+)?$/.test(arg));
422-
}
423-
424-
function run(entryFunction) {
425-
if (process._debugWaitConnect && isDebugBreak()) {
426-
427-
// XXX Fix this terrible hack!
428-
//
429-
// Give the client program a few ticks to connect.
430-
// Otherwise, there's a race condition where `node debug foo.js`
431-
// will not be able to connect in time to catch the first
432-
// breakpoint message on line 1.
433-
//
434-
// A better fix would be to somehow get a message from the
435-
// V8 debug object about a connection, and runMain when
436-
// that occurs. --isaacs
437-
438-
const debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50;
439-
setTimeout(entryFunction, debugTimeout);
440-
441-
} else {
442-
// Main entry point into most programs:
443-
entryFunction();
444-
}
445-
}
446-
447418
function checkScriptSyntax(source, filename) {
448419
const Module = NativeModule.require('module');
449420
const vm = NativeModule.require('vm');

node.gyp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
'library_files': [
2424
'lib/internal/bootstrap_node.js',
2525
'lib/_debug_agent.js',
26-
'lib/_debugger.js',
2726
'lib/assert.js',
2827
'lib/buffer.js',
2928
'lib/child_process.js',

test/debugger/test-debug-break-on-uncaught.js

-134
This file was deleted.

0 commit comments

Comments
 (0)