tc39 / proposal-promise-any

ECMAScript proposal: Promise.any
https://tc39.es/proposal-promise-any/
200 stars 27 forks source link

Spec bug - Promise.any(elements) should be rejected if all elements are rejected #47

Closed jorendorff closed 4 years ago

jorendorff commented 5 years ago

Promise.any Reject Element Functions step 11 says:

  1. If remainingElementsCount.[[Value]] is 0, then
    1. Perform ? ThrowAggregateError(errors).

I think this rejects the wrong promise. It should behave like Promise.all and Promise.any, and deliver the results to the promiseCapability fetched in step 7. (Currently that capability is unused.)