Permalink
Browse files

debugger: fix another error handling issue, added test

  • Loading branch information...
1 parent 255bdac commit 01b5435b722abe35b2ac5e78bcc6d29970cb583b @indutny committed Sep 26, 2011
Showing with 23 additions and 0 deletions.
  1. +2 −0 lib/_debugger.js
  2. +5 −0 test/fixtures/breakpoints.js
  3. +16 −0 test/simple/test-debugger-repl.js
View
@@ -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];
@@ -14,3 +14,8 @@ a();
a(1);
b();
b();
+
+
+
+setInterval(function() {
+}, 5000);
@@ -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();
@@ -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);

0 comments on commit 01b5435

Please sign in to comment.