tc39 / proposal-array-from-async

Draft specification for a proposed Array.fromAsync method in JavaScript.
http://tc39.es/proposal-array-from-async/
BSD 3-Clause "New" or "Revised" License
177 stars 13 forks source link

Async callbacks #4

Closed zloirock closed 3 years ago

zloirock commented 3 years ago

Now, in the spec draft we have:

Снимок экрана 2021-09-01 в 14 04 01

However, in related methods of iterator helpers proposal, we await the result of the mapper:

Снимок экрана 2021-09-01 в 14 05 19

It should be consistent.

js-choi commented 3 years ago

Thank you for catching this; this is a good point.

I agree that the mapper function should be considered as an async function and its results should be awaited, in order to match iterator-helpers’ behavior. I will change this later if there are no objections from anyone else. CC: @codehag

js-choi commented 3 years ago

The spec and explainer have been updated in 15ed9ce2d47ba88c5dea8ba3a2a58cd4e36e4af7.