tc39 / proposal-joint-iteration

a TC39 proposal to synchronise the advancement of multiple iterators
https://tc39.es/proposal-joint-iteration
70 stars 2 forks source link

clarify iterator lists #21

Closed bakkot closed 7 months ago

bakkot commented 7 months ago

Revisiting this I found some parts confusing, so I've tweaked it a bit to clarify.

The Assert: _openIters_ is not empty. step won't be true until after https://github.com/tc39/proposal-joint-iteration/pull/20 lands.

An alternative to replacing elements of _iters_ with null and tracking _openIters_ as separate list could be to just rely on the [[Done]] field of Iterator Records. That would require updating IteratorCloseAll to filter out the [[Done]]: true ones, though.

bakkot commented 7 months ago

Nice, done.