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

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

Issue 11358122: Object.observe: Fixed missing case for turning off ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" },
+]);
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698