Object.observe: Unblacklist some tests involving indexed properties
authorrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 21 Nov 2012 12:50:49 +0000 (12:50 +0000)
committerrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 21 Nov 2012 12:50:49 +0000 (12:50 +0000)
These were erroneously disabled because they were expecting indexed properties to be of Number type when appearing as the "name" in change records. But the "name" property will always be a string. Fixed assertRecordsEqual() to enforce this in expectations.

BUG=v8:2409

Review URL: https://codereview.chromium.org/11280105
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/mjsunit/harmony/object-observe.js

index 26d097e..ebfae0a 100644 (file)
@@ -56,6 +56,8 @@ function createObserver() {
     assertCallbackRecords: function(recs) {
       this.assertRecordCount(recs.length);
       for (var i = 0; i < recs.length; i++) {
+        if ('name' in recs[i])
+          recs[i].name = String(recs[i].name);
         print(i, JSON.stringify(this.records[i]), JSON.stringify(recs[i]));
         assertSame(this.records[i].object, recs[i].object);
         assertEquals('string', typeof recs[i].type);
@@ -495,11 +497,9 @@ var properties = ["a", "1", 1, "length", "prototype"];
 // Cases that yield non-standard results.
 // TODO(observe): ...or don't work yet.
 function blacklisted(obj, prop) {
-  return (obj instanceof Array && prop == 1) ||
-    (obj instanceof Int32Array && prop == 1) ||
+  return (obj instanceof Int32Array && prop == 1) ||
     (obj instanceof Int32Array && prop === "length") ||
-    // TODO(observe): oldValue when deleting/reconfiguring indexed accessor
-    prop == 1 ||
+    (obj instanceof ArrayBuffer && prop == 1) ||
     // TODO(observe): oldValue when reconfiguring array length
     (obj instanceof Array && prop === "length") ||
     // TODO(observe): prototype property on functions