Index: test/webkit/fast/js/Promise-resolve-with-then-exception.js |
diff --git a/test/webkit/dfg-intrinsic-osr-exit.js b/test/webkit/fast/js/Promise-resolve-with-then-exception.js |
similarity index 74% |
copy from test/webkit/dfg-intrinsic-osr-exit.js |
copy to test/webkit/fast/js/Promise-resolve-with-then-exception.js |
index 4ac756c310f3de11b37ef554399c35a764af8cd9..2604cb6e381a8c6143c6c9fdf738b5278c943ce7 100644 |
--- a/test/webkit/dfg-intrinsic-osr-exit.js |
+++ b/test/webkit/fast/js/Promise-resolve-with-then-exception.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,23 @@ |
// (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 callback; |
+var result; |
-for (var i = 0; i < 100; ++i) |
- foo([Math.abs], {f:5}); |
+new Promise(function(resolve) { |
+ resolve({then: function() { throw 'hello'; }}); |
+}).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 already rejected now.'); |