| Index: test/webkit/fast/js/Promise-onRejected-deep.js
|
| diff --git a/test/webkit/dfg-float32-array-nan.js b/test/webkit/fast/js/Promise-onRejected-deep.js
|
| similarity index 71%
|
| copy from test/webkit/dfg-float32-array-nan.js
|
| copy to test/webkit/fast/js/Promise-onRejected-deep.js
|
| index 4a62f40f0dffb851e38f3521e462f91081e4b584..b9c281fba6c042a2612e4e857d44e2909b02bba4 100644
|
| --- a/test/webkit/dfg-float32-array-nan.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,25 +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 what happens in the DFG JIT if we load from a Float32 array that contains a weirdly formatted NaN."
|
| -);
|
| +// Flags: --harmony
|
| +'use strict';
|
| +description('Test whether deeply chained then-s work.');
|
|
|
| -var buffer = new ArrayBuffer(4);
|
| +var result;
|
| +var reject;
|
| +var promise = new Promise(function (_, r) { reject = r; });
|
|
|
| -var int32View = new Int32Array(buffer);
|
| -var floatView = new Float32Array(buffer);
|
| -
|
| -int32View[0] = -4587521;
|
| -
|
| -debug(int32View[0]);
|
| -
|
| -function foo(o) {
|
| - debug(o[0]);
|
| - return o[0];
|
| +for (var i = 0; i < 5000; ++i) {
|
| + promise = promise.then(function (value) { testFailed('fulfilled'); throw value + 1; }, function (value) { throw value + 1; });
|
| }
|
|
|
| -for (var i = 0; i < 100; ++i)
|
| - shouldBe("\"\" + foo(floatView)", "\"NaN\"");
|
| +promise.catch(function (value) {
|
| + result = value;
|
| + shouldBe('result', '5042');
|
| +}).then(finishJSTest, finishJSTest);
|
|
|
| -debug("I didn't crash, which is a good thing.");
|
| +shouldBe('result', 'undefined');
|
| +reject(42);
|
|
|