Skip to content

Spec Issue: IteratorStep returns a promise for async iterators, leading to an infinite loop #33

Closed
@mgaudet

Description

@mgaudet

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:"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions