|
|
@ -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); |
|
|
|
}); |
|
|
|
}; |
|
|
|