Index: test/webkit/fast/js/Promise-onRejected-deep.js |
diff --git a/test/webkit/dfg-call-method-hit-watchpoint.js b/test/webkit/fast/js/Promise-onRejected-deep.js |
similarity index 71% |
copy from test/webkit/dfg-call-method-hit-watchpoint.js |
copy to test/webkit/fast/js/Promise-onRejected-deep.js |
index 8c486c786e3e88b262d430b998b3ddc29b25f94c..b9c281fba6c042a2612e4e857d44e2909b02bba4 100644 |
--- a/test/webkit/dfg-call-method-hit-watchpoint.js |
+++ b/test/webkit/fast/js/Promise-onRejected-deep.js |
@@ -1,4 +1,4 @@ |
-// Copyright 2013 the V8 project authors. All rights reserved. |
+// Copyright 2014 the V8 project authors. All rights reserved. |
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without |
@@ -21,32 +21,22 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-description( |
-"Tests correctness of method calls when the prototype is changed." |
-); |
+// Flags: --harmony |
+'use strict'; |
+description('Test whether deeply chained then-s work.'); |
-function Thingy() { |
-} |
- |
-Thingy.prototype = { |
- foo: function() { |
- return 42; |
- } |
-}; |
+var result; |
+var reject; |
+var promise = new Promise(function (_, r) { reject = r; }); |
-function callFoo(o) { |
- return o.foo(); |
+for (var i = 0; i < 5000; ++i) { |
+ promise = promise.then(function (value) { testFailed('fulfilled'); throw value + 1; }, function (value) { throw value + 1; }); |
} |
-var o = new Thingy(); |
+promise.catch(function (value) { |
+ result = value; |
+ shouldBe('result', '5042'); |
+}).then(finishJSTest, finishJSTest); |
-for (var i = 0; i < 200; ++i) { |
- if (i == 150) |
- Thingy.prototype.foo = function() { return 56; } |
- var expected; |
- if (i < 150) |
- expected = 42; |
- else |
- expected = 56; |
- shouldBe("callFoo(o)", "" + expected); |
-} |
+shouldBe('result', 'undefined'); |
+reject(42); |