Index: src/d8.js |
=================================================================== |
--- src/d8.js (revision 1268) |
+++ src/d8.js (working copy) |
@@ -381,6 +381,10 @@ |
var request = this.createRequest('evaluate'); |
request.arguments = {}; |
request.arguments.expression = expression; |
+ // Request a global evaluation if there is no current frame. |
+ if (Debug.State.currentFrame == kNoFrame) { |
+ request.arguments.global = true; |
+ } |
return request.toJSONProtocol(); |
} |
}; |
@@ -795,7 +799,7 @@ |
case 'evaluate': |
case 'lookup': |
if (last_cmd == 'p' || last_cmd == 'print') { |
- details.text = body.text; |
+ result = body.text; |
} else { |
var value = response.bodyValue(); |
if (value.isObject()) { |
@@ -984,10 +988,10 @@ |
ProtocolPackage.prototype.bodyValue = function(index) { |
- if (IS_UNDEFINED(index)) { |
+ if (index) { |
+ return new ProtocolValue(this.packet_.body[index], this); |
+ } else { |
return new ProtocolValue(this.packet_.body, this); |
- } else { |
- return new ProtocolValue(this.packet_.body[index], this); |
} |
} |