debugger: exit process on repl exit

* When entering repl - clone 'SIGINT' listeners array (instead of using
existing), as it will be spliced in .removeAllListeners() call later.
pull/24503/head
Fedor Indutny 2012-03-18 16:20:41 +06:00
parent d8c4ecea0b
commit f61d4b7a87
1 changed files with 5 additions and 1 deletions

View File

@ -755,6 +755,10 @@ function Interface(stdin, stdout, args) {
this.controlEval.bind(this), false, true); this.controlEval.bind(this), false, true);
// Kill child process when main process dies // Kill child process when main process dies
this.repl.on('exit', function() {
process.exit(0);
});
process.on('exit', function() { process.on('exit', function() {
self.killChild(); self.killChild();
}); });
@ -1486,7 +1490,7 @@ Interface.prototype.repl = function() {
self.print('Press Ctrl + C to leave debug repl'); self.print('Press Ctrl + C to leave debug repl');
// Don't display any default messages // Don't display any default messages
var listeners = this.repl.rli.listeners('SIGINT'); var listeners = this.repl.rli.listeners('SIGINT').slice(0);
this.repl.rli.removeAllListeners('SIGINT'); this.repl.rli.removeAllListeners('SIGINT');
// Exit debug repl on Ctrl + C // Exit debug repl on Ctrl + C