Skip to content

Commit

Permalink
lib: remove _debugger.js
Browse files Browse the repository at this point in the history
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: nodejs#12495
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis committed Apr 21, 2017
1 parent e0b076a commit 90476ac
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 2,515 deletions.
1,791 changes: 0 additions & 1,791 deletions lib/_debugger.js

This file was deleted.

33 changes: 2 additions & 31 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@

const internalModule = NativeModule.require('internal/module');
internalModule.addBuiltinLibsToObject(global);
run(() => {
evalScript('[eval]');
});
evalScript('[eval]');
} else if (process.argv[1]) {
// make process.argv[1] into a full path
const path = NativeModule.require('path');
Expand All @@ -143,7 +141,7 @@
}

preloadModules();
run(Module.runMain);
Module.runMain();
} else {
preloadModules();
// If -i or --interactive were passed, or stdin is a TTY.
Expand Down Expand Up @@ -417,33 +415,6 @@
}
}

function isDebugBreak() {
return process.execArgv.some((arg) => /^--debug-brk(=[0-9]+)?$/.test(arg));
}

function run(entryFunction) {
if (process._debugWaitConnect && isDebugBreak()) {

// XXX Fix this terrible hack!
//
// Give the client program a few ticks to connect.
// Otherwise, there's a race condition where `node debug foo.js`
// will not be able to connect in time to catch the first
// breakpoint message on line 1.
//
// A better fix would be to somehow get a message from the
// V8 debug object about a connection, and runMain when
// that occurs. --isaacs

const debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50;
setTimeout(entryFunction, debugTimeout);

} else {
// Main entry point into most programs:
entryFunction();
}
}

function checkScriptSyntax(source, filename) {
const Module = NativeModule.require('module');
const vm = NativeModule.require('vm');
Expand Down
1 change: 0 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
'library_files': [
'lib/internal/bootstrap_node.js',
'lib/_debug_agent.js',
'lib/_debugger.js',
'lib/assert.js',
'lib/buffer.js',
'lib/child_process.js',
Expand Down
134 changes: 0 additions & 134 deletions test/debugger/test-debug-break-on-uncaught.js

This file was deleted.

Loading

0 comments on commit 90476ac

Please sign in to comment.