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) }); |
+})(); |