archives

« Bugzilla Issues Index

#2514 — Promise.all() and Promise.race() can't take a "promise for an array"


Most existing promise implementations allow the all/race methods to take a promise of an array, in addition to a direct array. That is, they Promise.cast() their argument. The spec should permit the argument to be a promise of an iterable.


I don't think we should do this. It adds complexity and an extra event loop tick to the common case. You also have the question of what to do with things that have both a `then` method and an `@@iterator`.


I don't feel strongly about this issue.