Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

%WrapForValidAsyncIteratorPrototype%.next does not validate result #204

@2767mr

Description

@2767mr

All variations of .next throw or reject if the result is not an object except for %WrapForValidAsyncIteratorPrototype%.next.
This is because IteratorNext is used to do that check but IteratorNext only checks if the result is an object, which also returns true for promises.

An example:

let foo = {
    [Symbol.asyncIterator]() {
         return {
              async next() {
                  return null;
              }
         }
    }
}
await AsyncIterator.from(foo).next(); //Should throw TypeError but does not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions