Index: test/debugger/test-api.js |
diff --git a/test/debugger/test-api.js b/test/debugger/test-api.js |
index f78b1171af005584399edd907a86d5682d543bd5..a9bcaf213af25d3147b463cf381741365f5fc7ca 100644 |
--- a/test/debugger/test-api.js |
+++ b/test/debugger/test-api.js |
@@ -518,6 +518,14 @@ class DebugWrapper { |
return { value : () => localValue }; |
} |
+ reconstructValue(objectId) { |
+ const {msgid, msg} = this.createMessage( |
+ "Runtime.getProperties", { objectId : objectId, ownProperties: true }); |
+ this.sendMessage(msg); |
+ const reply = this.takeReplyChecked(msgid); |
+ return Object(reply.result.internalProperties[0].value.value); |
+ } |
+ |
reconstructRemoteObject(obj) { |
let value = obj.value; |
let isUndefined = false; |
@@ -553,7 +561,20 @@ class DebugWrapper { |
break; |
} |
default: { |
- value = this.propertiesToObject(this.getProperties(obj.objectId)); |
+ switch (obj.className) { |
+ case "global": |
+ value = Function('return this')(); |
+ break; |
+ case "Number": |
+ case "String": |
+ case "Boolean": |
+ value = this.reconstructValue(obj.objectId); |
+ break; |
+ default: |
+ value = this.propertiesToObject( |
+ this.getProperties(obj.objectId)); |
+ break; |
+ } |
break; |
} |
} |