this.reqBacktrace(function(err, trace) {
if (err) return cb(err);
+ if (trace.totalFrames <= 0) return cb(Error('No frames'));
var refs = [];
}
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];
self.pause();
client.fullTrace(function(err, bt) {
- if (err) return self.error(err);
+ if (err) return self.error('Can\'t request backtrace now');
if (bt.totalFrames == 0) {
self.print('(empty stack)');
} else {
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();
"\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);