Index: test/mjsunit/harmony/object-observe.js |
diff --git a/test/mjsunit/harmony/object-observe.js b/test/mjsunit/harmony/object-observe.js |
index 6a0fc0dfea131f367345a1ac15ec858243377431..e90ddaf601ad9abd08ba78e316b8fe3e101ab706 100644 |
--- a/test/mjsunit/harmony/object-observe.js |
+++ b/test/mjsunit/harmony/object-observe.js |
@@ -323,3 +323,35 @@ observer.assertCallbackRecords([ |
{ object: obj, name: "1", type: "updated", oldValue: undefined }, |
{ object: obj, name: "1", type: "updated", oldValue: 9 }, |
]); |
+ |
+ |
+// Assignments in loops (checking different IC states). |
+reset(); |
+var obj = {}; |
+Object.observe(obj, observer.callback); |
+for (var i = 0; i < 5; i++) { |
+ obj["a" + i] = i; |
+} |
+Object.deliverChangeRecords(observer.callback); |
+observer.assertCallbackRecords([ |
+ { object: obj, name: "a0", type: "new" }, |
+ { object: obj, name: "a1", type: "new" }, |
+ { object: obj, name: "a2", type: "new" }, |
+ { object: obj, name: "a3", type: "new" }, |
+ { object: obj, name: "a4", type: "new" }, |
+]); |
+ |
+reset(); |
+var obj = {}; |
+Object.observe(obj, observer.callback); |
+for (var i = 0; i < 5; i++) { |
+ obj[i] = i; |
+} |
+Object.deliverChangeRecords(observer.callback); |
+observer.assertCallbackRecords([ |
+ { object: obj, name: "0", type: "new" }, |
+ { object: obj, name: "1", type: "new" }, |
+ { object: obj, name: "2", type: "new" }, |
+ { object: obj, name: "3", type: "new" }, |
+ { object: obj, name: "4", type: "new" }, |
+]); |