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

Unified Diff: test/webkit/fast/js/Promise-onFulfilled-deep.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-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);
« no previous file with comments | « test/webkit/fast/js/Promise-init-expected.txt ('k') | test/webkit/fast/js/Promise-onFulfilled-deep-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698