Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: test/webkit/fast/js/Promise-resolve-with-itself.js

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/webkit/fast/js/Promise-resolve-with-itself.js
diff --git a/test/webkit/array-tostring-and-join.js b/test/webkit/fast/js/Promise-resolve-with-itself.js
similarity index 71%
copy from test/webkit/array-tostring-and-join.js
copy to test/webkit/fast/js/Promise-resolve-with-itself.js
index b4fdb51b47f0b450a53fc725a133c27a21c5375d..22d05cd2922971c96f53d503b33d8738edaaf29c 100644
--- a/test/webkit/array-tostring-and-join.js
+++ b/test/webkit/fast/js/Promise-resolve-with-itself.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,16 +21,20 @@
// (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(
+// Flags: --harmony
+'use strict';
+description('Test whether Promise will be rejected if it is resolved with itself.');
-"This test checks that toString and join share the same HashSet for visited elements."
+var resolve;
+var result;
-);
+var promise = new Promise(function(r) { resolve = r; });
+promise.then(function () {
+ testFailed('fulfilled');
+}, function (error) {
+ testPassed('rejected');
+ result = error.toString();
+ shouldBeEqualToString('result', 'TypeError: Chaining cycle detected for promise #<Promise>');
+}).then(finishJSTest, finishJSTest);
-var arr = [1, 2];
-var obj = {};
-obj.__proto__.toString = function() { return "*" + arr + "*"; }
-arr[2] = arr;
-arr[3] = obj;
-
-shouldBe("arr.join()", "'1,2,,**'");
+resolve(promise);
« no previous file with comments | « test/webkit/fast/js/Promise-resolve-state-expected.txt ('k') | test/webkit/fast/js/Promise-resolve-with-itself-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698