From 680fc1ec1fb4daf9471edf7d6a5ad6aea5292418 Mon Sep 17 00:00:00 2001 From: "rossberg@chromium.org" Date: Mon, 10 Mar 2014 11:52:13 +0000 Subject: [PATCH] Promise.all and Promise race should use "then" rather than "chain". As specified, they should unwrap resolution values recursively. BUG=347427 LOG=Y R=rossberg@chromium.org Review URL: https://codereview.chromium.org/181613006 Patch from Yutaka Hirano . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19752 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/promise.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/promise.js b/src/promise.js index 82aa99027..1f6c3514a 100644 --- a/src/promise.js +++ b/src/promise.js @@ -254,7 +254,7 @@ function PromiseAll(values) { deferred.resolve(resolutions); } else { for (var i = 0; i < values.length; ++i) { - this.cast(values[i]).chain( + this.cast(values[i]).then( function(i, x) { resolutions[i] = x; if (--count === 0) deferred.resolve(resolutions); @@ -273,7 +273,7 @@ function PromiseOne(values) { var deferred = %_CallFunction(this, PromiseDeferred); try { for (var i = 0; i < values.length; ++i) { - this.cast(values[i]).chain( + this.cast(values[i]).then( function(x) { deferred.resolve(x) }, function(r) { deferred.reject(r) } ); -- 2.34.1