In the following spec text, passing the result of IteratorStep to IteratorValue does not make sense, since if the iterator is done, the return value of IteratorStep is DONE, not the iterator result object expected by IteratorValue:
|
1. Let _iteratorResult_ be ? IteratorStep(_iteratorRecord_). |
|
1. If _iteratorResult_ is ~done~, then |
|
1. Perform ? IteratorValue(_iteratorResult_). |
To fix this, IteratorStep probably has to be replaced with explicit IteratorNext and IteratorComplete calls.