Reviewers: rossberg,
Description:
Unblacklist some Object.observe tests involving indexed properties
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
Please review this at https://codereview.chromium.org/11280105/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M test/mjsunit/harmony/object-observe.js
Index: test/mjsunit/harmony/object-observe.js
diff --git a/test/mjsunit/harmony/object-observe.js
b/test/mjsunit/harmony/object-observe.js
index
26d097ecee7f50106cd64f2e8ebe4aa8f73a7b4c..ebfae0a9139db36964989c215bbd5d05dc98a50b
100644
--- a/test/mjsunit/harmony/object-observe.js
+++ b/test/mjsunit/harmony/object-observe.js
@@ -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
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev