On 11/1/19 6:08 AM, Paolo Amadini wrote:
On 10/31/2019 1:57 PM, Jan-Ivar Bruaroey wrote:
The context here is the same as Promise.allSettled: we explicitly *do*
want to ignore errors, right?
In general, in mozilla-central we want to at least log those errors, at
which point they are already caught, and using "Promise.all" is then
equivalent (which if I understand correctly was your original point).
No, they're never equivalent, except where failure is impossible.
Promise composition tools are different waiting semantics. [1]
We're discussing the JS language here, not testing & mozilla-central.
My original point was that the semantics of Promise.allSettled, which
are "keep waiting for the lot even if some async operations fail", did
not deserve its own standard name in the JS language, because of
A) how rarely this is actually what you want,
B) how easy it is to accomplish when it is, using patterns like e.g.
Promise.all(promises.map(p => p.catch(e => e)) & friends, and
C) (your point?) bugs from people wrongly using instead of Promise.all
.: Jan-Ivar :.
[1]
https://github.com/tc39/proposal-promise-any/#ecmascript-proposal-promiseany
.: Jan-Ivar :.
Cheers,
Paolo
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform