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