Reviewers: rossberg,
Description:
Add test that inherited properties are preserved for synthetic change
records
R=rossberg
BUG=
Please review this at https://codereview.chromium.org/309573002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+26, -0 lines):
M test/mjsunit/es7/object-observe.js
Index: test/mjsunit/es7/object-observe.js
diff --git a/test/mjsunit/es7/object-observe.js
b/test/mjsunit/es7/object-observe.js
index
7bb579f0c1462b6b33ff1bc6c3229067317f2845..337a9cb5546c412be5851365254caa0dc0670a4b
100644
--- a/test/mjsunit/es7/object-observe.js
+++ b/test/mjsunit/es7/object-observe.js
@@ -210,6 +210,32 @@ observer.assertCallbackRecords([
{ object: obj, name: 'bar', type: 'delete', expando2: 'str' }
]);
+// Properties from prototype of synthetic change records are preserved
+reset();
+Object.observe(obj, observer.callback);
+notifier = Object.getNotifier(obj);
+var proto = {
+ type: 'update',
+ foo: 'bar'
+};
+var rec = Object.create(proto);
+rec.oldValue = 3;
+notifier.notify(rec);
+
+var rec2 = Object.create(proto);
+proto.type = 'delete';
+rec.oldValue = 5;
+
+notifier.performChange('delete', function() {
+ return rec;
+})
+
+Object.deliverChangeRecords(observer.callback);
+observer.assertCallbackRecords([
+ { object: obj, type: 'update', foo: 'bar', oldValue: 3 },
+ { object: obj, type: 'delete', foo: 'bar', oldValue: 5 },
+]);
+
// Non-string accept values are coerced to strings
reset();
Object.observe(obj, observer.callback, [true, 1, null, undefined]);
--
--
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.