From fe4b0f40d6f105d502f341e41b0a9cf74bdf80bd Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 10 Sep 2011 23:55:38 +0700 Subject: [PATCH] [debugger] fixed piping from stdout of child process, fixed eval in debug repl (when not on breakpoint) --- lib/_debugger.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index 4575b17..7c054cf 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -409,6 +409,7 @@ Client.prototype.reqScripts = function(cb) { Client.prototype.reqContinue = function(cb) { + this.currentFrame = NO_FRAME; this.req({ command: 'continue' }, function(res) { if (cb) cb(res); }); @@ -451,6 +452,7 @@ Client.prototype.step = function(action, count, cb) { arguments: { stepaction: action, stepcount: count } }; + this.currentFrame = NO_FRAME; this.req(req, function(res) { if (cb) cb(res); }); @@ -519,7 +521,7 @@ Client.prototype.mirrorObject = function(handle, depth, cb) { name: prop.name, value: mirrorValue }; - if (value.handle && depth > 0) { + if (value && value.handle && depth > 0) { waiting++; self.mirrorObject(value, depth - 1, function(result) { keyValues[i].value = result; @@ -760,7 +762,8 @@ Interface.prototype.childPrint = function(text) { return chunk; }).map(function(chunk) { return '< ' + chunk; - }).join('\n') + '\n'); + }).join('\n')); + this.repl.displayPrompt(); }; Interface.prototype.error = function(text) { @@ -807,8 +810,14 @@ Interface.prototype.debugEval = function(code, context, filename, callback) { return; } + var frame; + + if (client.currentFrame === NO_FRAME) { + frame = NO_FRAME; + }; + self.pause(); - client.reqFrameEval(code, undefined, function(res) { + client.reqFrameEval(code, frame, function(res) { if (!res.success) { if (res.message) { callback(res.message); -- 2.7.4