tc39 / proposal-async-iterator-helpers

Methods for working with async iterators in ECMAScript
https://tc39.es/proposal-async-iterator-helpers/
95 stars 3 forks source link

What does GetIteratorFlattenable mean? #19

Closed MadProbe closed 4 months ago

MadProbe commented 4 months ago

Could someone please explain to me how does second step in https://tc39.es/proposal-async-iterator-helpers/#sec-asynciterator.from (Let iteratorRecord be ? GetIteratorFlattenable(O, async).) actually differ from regular GetIteratorFlattenable(O, iterate-strings).?

ljharb commented 4 months ago

It seems like the spec text is either missing an altered implementation of GetIteratorFlattenable, or, it's being called incorrectly.

MadProbe commented 4 months ago

I have viewed the history of the main repo for pre-split version of proposal and it seems like current AsyncIterator.from and AsyncIterator.prototype.flatMap spec references pre-split version of GetIteratorFlattenable and it wasn't updated properly to either update GetIteratorFlattanable with pre-split logic in case of async or to have separate AO named GetAsyncIteratorFlattanable just with logic of async case.

bakkot commented 4 months ago

The spec text is not current; please don't refer to it.