Reviewers: rossberg,

Message:
PTAL?

I will add tests for them soon.


Description:
Promise.all and Promise race should use "then" rather than "chain".

As specified, they should unwrap resolution values.

BUG=347427
[email protected]

Please review this at https://codereview.chromium.org/181613006/

SVN Base: git://github.com/v8/v8.git@master

Affected files (+2, -2 lines):
  M src/promise.js


Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index 82aa99027a1305ac8bf6b95672cccd89504173cd..1f6c3514ac42f52dfa291476c99f3b30395872ce 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) }
       );


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to