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

Unified Diff: test/mjsunit/es7/object-observe.js

Issue 309573002: Add test that inherited properties are preserved for synthetic change records Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
rossberg 2014/06/02 09:14:15 I don't understand, this is never used.
rafaelw 2014/06/02 18:32:20 removed. On 2014/06/02 09:14:15, rossberg wrote:
rossberg 2014/06/03 10:41:56 Ah, OK. I wasn't sure if the intention was to use
+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]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698