For example, Iterator.zip step 13.b puts inputIter in openIters, and then 13.d.ii closes everything in openIters (including inputIter) if the reading the value property of the iterator result object from inputIter throws.
But a throwy getter for the value property from the iterator result object from inputIter is a violation of the iterator protocol, and so should not cause inputIter to be closed.
Similarly for step 13.d.vii/viii.
inputIter should probably not get put in openIters at the start of the loop. Instead, only add it after the Let iter be Completion(GetIteratorFlattenable(value, ITERATE-STRINGS)) step in the case that this step is an abrupt completion: something like
1. If _iter_ is an abrupt completion, then
1. Set _openIters_ to the list-concatenation of « _inputIter_ » and _openIters_.
1. Return ? IteratorCloseAll(_openIters_, _iter_).
For example,
Iterator.zip
step 13.b putsinputIter
inopenIters
, and then 13.d.ii closes everything inopenIters
(includinginputIter
) if the reading thevalue
property of the iterator result object frominputIter
throws.But a throwy getter for the
value
property from the iterator result object frominputIter
is a violation of the iterator protocol, and so should not causeinputIter
to be closed.Similarly for step 13.d.vii/viii.
inputIter
should probably not get put inopenIters
at the start of the loop. Instead, only add it after theLet iter be Completion(GetIteratorFlattenable(value, ITERATE-STRINGS))
step in the case that this step is an abrupt completion: something like