Browse Source

debugger: use correct handle handle

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
d040f1d19d
  1. 6
      lib/_debugger.js

6
lib/_debugger.js

@ -128,7 +128,7 @@ exports.Client = Client;
Client.prototype._addHandle = function(desc) {
if (typeof desc != 'object' || !desc.handle) throw new Error("bad type");
this.handles[desc.id] = desc;
this.handles[desc.handle] = desc;
if (desc.type == 'script') {
this._addScript(desc);
@ -208,11 +208,13 @@ Client.prototype.reqVersion = function(cb) {
Client.prototype.reqEval = function(expression, cb) {
var self = this;
var req = {
command: 'evaluate',
arguments: { expression: expression }
};
if (this.currentFrame == NO_FRAME) {
req.arguments.global = true;
} else {
@ -220,6 +222,8 @@ Client.prototype.reqEval = function(expression, cb) {
}
this.req(req, function (res) {
console.error('reqEval res ', res.body);
self._addHandle(res.body);
if (cb) cb(res.body);
});
};

Loading…
Cancel
Save