| Index: test/webkit/fast/js/Promise-resolve-with-then-reject.js
|
| diff --git a/test/webkit/dfg-intrinsic-osr-exit.js b/test/webkit/fast/js/Promise-resolve-with-then-reject.js
|
| similarity index 69%
|
| copy from test/webkit/dfg-intrinsic-osr-exit.js
|
| copy to test/webkit/fast/js/Promise-resolve-with-then-reject.js
|
| index 4ac756c310f3de11b37ef554399c35a764af8cd9..1923a8de1a1339f8365f4726c8564c267820ec6a 100644
|
| --- a/test/webkit/dfg-intrinsic-osr-exit.js
|
| +++ b/test/webkit/fast/js/Promise-resolve-with-then-reject.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,20 +21,31 @@
|
| // (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(
|
| -"This tests that an OSR exit inside of an intrinsic that was not loaded with a method check works correctly."
|
| -);
|
| +// Flags: --harmony
|
| +'use strict';
|
| +description('Test whether Promise treats thenable correctly.');
|
|
|
| -function foo(a,b) {
|
| - return a[0](b.f);
|
| -}
|
| +var thisValue;
|
| +var result;
|
| +var value = {
|
| + then: function(onFulfilled, onRejected) {
|
| + testPassed('value.then is called.');
|
| + thisValue = this;
|
| + shouldBe('thisValue', 'value');
|
| + onRejected('hello');
|
| + }
|
| +};
|
|
|
| -for (var i = 0; i < 100; ++i)
|
| - foo([Math.abs], {f:5});
|
| +new Promise(function(resolve) {
|
| + resolve(value);
|
| +}).then(function() {
|
| + testFailed('fulfilled');
|
| + finishJSTest();
|
| +}, function(localResult) {
|
| + testPassed('rejected');
|
| + result = localResult;
|
| + shouldBeEqualToString('result', 'hello');
|
| + finishJSTest();
|
| +});
|
|
|
| -shouldBe("foo([Math.abs], {f:5})", "5");
|
| -
|
| -for (var i = 0; i < 10; ++i)
|
| - shouldBe("foo([Math.abs], {f:5.5})", "5.5");
|
| -
|
| -var successfullyParsed = true;
|
| +debug('The promise is not rejected now.');
|
|
|