Revision: 22959
Author: [email protected]
Date: Thu Aug 7 08:36:38 2014 UTC
Log: Mirror object properties are always names
[email protected], [email protected], [email protected]
BUG=
Review URL: https://codereview.chromium.org/443843004
http://code.google.com/p/v8/source/detail?r=22959
Modified:
/branches/bleeding_edge/src/mirror-debugger.js
/branches/bleeding_edge/test/mjsunit/mirror-object.js
=======================================
--- /branches/bleeding_edge/src/mirror-debugger.js Wed Jul 30 09:31:06 2014
UTC
+++ /branches/bleeding_edge/src/mirror-debugger.js Thu Aug 7 08:36:38 2014
UTC
@@ -797,7 +797,7 @@
ObjectMirror.prototype.property = function(name) {
- var details = %DebugGetPropertyDetails(this.value_, %ToString(name));
+ var details = %DebugGetPropertyDetails(this.value_, %ToName(name));
if (details) {
return new PropertyMirror(this, name, details);
}
=======================================
--- /branches/bleeding_edge/test/mjsunit/mirror-object.js Mon Sep 10
23:17:04 2012 UTC
+++ /branches/bleeding_edge/test/mjsunit/mirror-object.js Thu Aug 7
08:36:38 2014 UTC
@@ -111,12 +111,14 @@
// Check that the serialization contains all properties.
assertEquals(names.length, fromJSON.properties.length, 'Some properties
missing in JSON');
- for (var i = 0; i < fromJSON.properties.length; i++) {
- var name = fromJSON.properties[i].name;
- if (typeof name == 'undefined') name = fromJSON.properties[i].index;
+ for (var j = 0; j < names.length; j++) {
+ var name = names[j];
+ // Serialization of symbol-named properties to JSON doesn't really
+ // work currently, as they don't get a {name: ...} entry.
+ if (typeof name === 'symbol') continue;
var found = false;
- for (var j = 0; j < names.length; j++) {
- if (names[j] == name) {
+ for (var i = 0; i < fromJSON.properties.length; i++) {
+ if (fromJSON.properties[i].name == name) {
// Check that serialized handle is correct.
assertEquals(properties[i].value().handle(),
fromJSON.properties[i].ref, 'Unexpected serialized handle');
@@ -169,6 +171,9 @@
this.x_ = x;
this.y_ = y;
}
+
+var object_with_symbol = {};
+object_with_symbol[Symbol.iterator] = 42;
// Test a number of different objects.
testObjectMirror({}, 'Object', 'Object');
@@ -180,6 +185,7 @@
testObjectMirror([], 'Array', 'Array');
testObjectMirror([1,2], 'Array', 'Array');
testObjectMirror(Object(17), 'Number', 'Number');
+testObjectMirror(object_with_symbol, 'Object', 'Object');
// Test circular references.
o = {};
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.