Closed
Description
Are synchronous iterables/array-likes being iterated synchronously or asynchronously as they would in a for await
? What is the expectation for a rejection within a sync collection that settles before to other promises prior? In a for await
it goes unhandled. Would Array.fromAsync()
be able to account for that and reject its returned promise or would it to allow for the unhandled rejection to slip through?
const delay = (ms, reject = false) => new Promise((r, j) => setTimeout(reject ? j : r, ms, ms));
for await (let ms of [delay(1000), delay(3000), delay(2000, true)]) {
console.log(ms) // 1000, (unhandled error 2000), 3000
}