Index: test/webkit/fast/js/Promise-onFulfilled-deep.js |
diff --git a/test/webkit/dfg-arguments-cross-code-origin.js b/test/webkit/fast/js/Promise-onFulfilled-deep.js |
similarity index 71% |
copy from test/webkit/dfg-arguments-cross-code-origin.js |
copy to test/webkit/fast/js/Promise-onFulfilled-deep.js |
index 0793dfa9acb5dd82d3360b069f384667bdf48281..9e19aa56b2ef6346a8c2e8fdea02143f30c2d348 100644 |
--- a/test/webkit/dfg-arguments-cross-code-origin.js |
+++ b/test/webkit/fast/js/Promise-onFulfilled-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,24 +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 uses of 'arguments' that are aliased but span code origins." |
-); |
+// Flags: --harmony |
+'use strict'; |
+description('Test whether deeply chained then-s work.'); |
-function foo() { |
- return arguments; |
-} |
+var result; |
+var resolve; |
+var promise = new Promise(function (r) { resolve = r; }); |
-function bar(a) { |
- var result = 0; |
- for (var i = 0; i < a.length; ++i) |
- result += a[i]; |
- return result; |
+for (var i = 0; i < 5000; ++i) { |
+ promise = promise.then(function (value) { return value + 1; }, function () { testFailed('rejected'); }); |
} |
-function baz(x) { |
- return bar(foo(x)); |
-} |
+promise.then(function (value) { |
+ result = value; |
+ shouldBe('result', '5042'); |
+}).then(finishJSTest, finishJSTest); |
-for (var i = 0; i < 200; ++i) |
- shouldBe("baz(42)", "42"); |
+shouldBe('result', 'undefined'); |
+resolve(42); |