Browse Source

debugger: breakOnException

Do not break automatically on exception, fixes #2926
v0.9.1-release
Fedor Indutny 13 years ago
parent
commit
7418905aef
  1. 23
      lib/_debugger.js

23
lib/_debugger.js

@ -678,6 +678,7 @@ var commands = [
'kill',
'list',
'scripts',
'breakOnException',
'breakpoints',
'version'
]
@ -1308,6 +1309,19 @@ Interface.prototype.watchers = function() {
}
};
// Break on exception
Interface.prototype.breakOnException = function breakOnException() {
if (!this.requireConnection()) return;
var self = this;
// Break on exceptions
this.pause();
this.client.reqSetExceptionBreak('all', function(err, res) {
self.resume();
});
};
// Add breakpoint
Interface.prototype.setBreakpoint = function(script, line,
condition, silent) {
@ -1626,12 +1640,6 @@ Interface.prototype.trySpawn = function(cb) {
self.setBreakpoint(bp.scriptId, bp.line, bp.condition, true);
});
// Break on exceptions
client.reqSetExceptionBreak('all', function(err, res) {
cb && cb();
self.resume();
});
client.on('close', function() {
self.pause();
self.print('program terminated');
@ -1639,6 +1647,9 @@ Interface.prototype.trySpawn = function(cb) {
self.client = null;
self.killChild();
});
if (cb) cb();
self.resume();
});
client.on('unhandledResponse', function(res) {

Loading…
Cancel
Save