Skip to content

Commit

Permalink
debugger: fix another error handling issue, added test
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Sep 26, 2011
1 parent 255bdac commit 01b5435
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/_debugger.js
Expand Up @@ -616,6 +616,8 @@ Client.prototype.fullTrace = function(cb) {
}

self.reqLookup(refs, function(res) {
if (!res.success) return cb(res.message || true);

for (var i = 0; i < trace.frames.length; i++) {
var frame = trace.frames[i];
frame.script = res.body[frame.script.ref];
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/breakpoints.js
Expand Up @@ -14,3 +14,8 @@ a();
a(1);
b();
b();



setInterval(function() {
}, 5000);
16 changes: 16 additions & 0 deletions test/simple/test-debugger-repl.js
Expand Up @@ -43,6 +43,7 @@ child.stderr.pipe(process.stdout);
var expected = [];

child.on('line', function(line) {
console.log(JSON.stringify(line));
assert.ok(expected.length > 0, 'Got unexpected line: ' + line);

var expectedLine = expected[0].lines.shift();
Expand Down Expand Up @@ -110,6 +111,21 @@ addTest('o', [
"\b 16 b();"
]);

// Continue
addTest('c', [
"debug> debug> debug> \bbreak in [unnamed]:7",
"\b 5 var i = 10;",
"\b 6 while (--i != 0);",
"\b 7 debugger;",
"\b 8 return i;",
"\b 9 };"
]);

// Continue
addTest('c, bt', [
"debug> \bCan't request backtrace now"
]);


function finish() {
process.exit(0);
Expand Down

0 comments on commit 01b5435

Please sign in to comment.