Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: test/mjsunit/mirror-object.js

Issue 443843004: Mirror object properties are always names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minimal change Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mirror-object.js
diff --git a/test/mjsunit/mirror-object.js b/test/mjsunit/mirror-object.js
index 8bf8a2d4f83181d46340bf00a34ec8f450ebcf86..7020338ca2232d2c51116fb094cd92e6ddff75f7 100644
--- a/test/mjsunit/mirror-object.js
+++ b/test/mjsunit/mirror-object.js
@@ -111,12 +111,14 @@ function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) {
// 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
rossberg 2014/08/06 15:54:34 This isn't ever supposed to work; symbol propertie
+ // 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');
@@ -170,6 +172,9 @@ function Point(x,y) {
this.y_ = y;
}
+var object_with_symbol = {};
+object_with_symbol[Symbol.iterator] = 42;
+
// Test a number of different objects.
testObjectMirror({}, 'Object', 'Object');
testObjectMirror({'a':1,'b':2}, 'Object', 'Object');
@@ -180,6 +185,7 @@ testObjectMirror(this.__proto__, 'Object', '');
testObjectMirror([], 'Array', 'Array');
testObjectMirror([1,2], 'Array', 'Array');
testObjectMirror(Object(17), 'Number', 'Number');
+testObjectMirror(object_with_symbol, 'Object', 'Object');
// Test circular references.
o = {};
« no previous file with comments | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698