Aligns Promise.all() and Promise.race() with the spec by supporting iterables as arguments. This is done by basically feature-detecting ES2015 and keeping the current behaviour in ES5 environments (which I assume are still intended to be supported).
[x] The Flow types shipped with promise already refer to iterables rather than arrays, so don't need to be updated.
[x] The official TypeScript definitions for Promise are silent on iterables for all() so nothing needs to be done for it here.
[ ] The official TypeScript definitions for Promise do have an iterable overload of race() but the types (where they do overlap) are not exactly what promise ships. I don't use TypeScript so I'm not sure what is desired here, and wouldn't be able to test my changes. We could choose to leave the types as they are for now.
Coverage decreased (-0.5%) to 95.266% when pulling a3a955b1bca0dd8b38ebf387739a3da177ed3c42 on motiz88:iterables into 81b57224a43b65bf50b0445f32f206429ad3d4b6 on then:master.
Aligns
Promise.all()
andPromise.race()
with the spec by supporting iterables as arguments. This is done by basically feature-detecting ES2015 and keeping the current behaviour in ES5 environments (which I assume are still intended to be supported).promise
already refer to iterables rather than arrays, so don't need to be updated.all()
so nothing needs to be done for it here.race()
but the types (where they do overlap) are not exactly whatpromise
ships. I don't use TypeScript so I'm not sure what is desired here, and wouldn't be able to test my changes. We could choose to leave the types as they are for now.cc @cpojer