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

Unified Diff: test/mjsunit/regress/regress-freeze.js

Issue 22562004: Fix Object.freeze, Object.observe wrt CountOperation and CompoundAssignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add regression test Created 7 years, 4 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 | « test/mjsunit/harmony/object-observe.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-freeze.js
diff --git a/test/mjsunit/regress/regress-crbug-242870.js b/test/mjsunit/regress/regress-freeze.js
similarity index 87%
copy from test/mjsunit/regress/regress-crbug-242870.js
copy to test/mjsunit/regress/regress-freeze.js
index 7183375ca811cedc81c870d34e694e98cf727f9b..6f3de2a4c98e532e7bcf530e893f2eadbbe96066 100644
--- a/test/mjsunit/regress/regress-crbug-242870.js
+++ b/test/mjsunit/regress/regress-freeze.js
@@ -27,17 +27,20 @@
// Flags: --allow-natives-syntax
-var non_const_true = true;
-
-function f() {
- return (non_const_true || true && g());
-}
-
-function g() {
- for (;;) {}
-}
-
-assertTrue(f());
-assertTrue(f());
+// CountOperation
+function f(o) { o.x++ };
+var o = {x: 5};
+Object.freeze(o);
+f(o);
+f(o);
%OptimizeFunctionOnNextCall(f);
-assertTrue(f());
+f(o);
+assertEquals(5, o.x);
+
+// Compound Assignment
+function f2(o) { o.x+=3 };
+f2(o);
+f2(o);
+%OptimizeFunctionOnNextCall(f2);
+f2(o);
+assertEquals(5, o.x);
« no previous file with comments | « test/mjsunit/harmony/object-observe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698