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

Unified Diff: test/mjsunit/es6/regress/regress-cr372788.js

Issue 281753004: Drop thenable coercion cache (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test 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 | « src/promise.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/regress/regress-cr372788.js
diff --git a/test/mjsunit/compiler/smi-stores-opt.js b/test/mjsunit/es6/regress/regress-cr372788.js
similarity index 80%
copy from test/mjsunit/compiler/smi-stores-opt.js
copy to test/mjsunit/es6/regress/regress-cr372788.js
index ca0923abc99501096d182bcdcd05f6f4020de9c9..9b66a7e08b3737cf26b0dc52e87f4e69bddbf729 100644
--- a/test/mjsunit/compiler/smi-stores-opt.js
+++ b/test/mjsunit/es6/regress/regress-cr372788.js
@@ -27,23 +27,19 @@
// Flags: --allow-natives-syntax
-var o = {a:1.5};
-o.a = 0;
-var a = o.a;
+var x = 0;
+var y = 0;
-function g() {
- return 1;
-}
-
-var o2 = {a:{}};
+var thenable = { then: function(f) { x++; f(); } };
-function f() {
- var result = {a: a};
- var literal = {x:g()};
- return [result, literal];
+for (var i = 0; i < 3; ++i) {
+ Promise.resolve(thenable).then(function() { x++; y++; });
}
+assertEquals(0, x);
-f();
-f();
-%OptimizeFunctionOnNextCall(f);
-assertEquals(1, f()[1].x);
+(function check() {
+ Promise.resolve().chain(function() {
+ // Delay check until all handlers have run.
+ if (y < 3) check(); else assertEquals(6, x);
+ }).catch(function(e) { %AbortJS("FAILURE: " + e) });
+})();
« no previous file with comments | « src/promise.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698