Description
In the published spec, Step 3.j.ii.3 and 4 are the termination condition of the iteration:
- Step 3.j.ii.3 "Let next be ? Await(IteratorStep(iteratorRecord))."
- Step 3.j.ii.4 "If next is false, then..."
The problem is that IteratorStep
doesn't properly flag termination on an async iterator; the return value of the IteratorNext
in async iteration is a Promise, which doesn't have a "done" property, and so we always get the promise object from IteratorStep
.
I think the patch is actually relatively simple; Step 3.j.ii.4 should be expanded into the steps which have the effect of "if next.done
is false:"