Skip to content

Why missed a fallback to sync @@iterator? #6

Closed
@zloirock

Description

@zloirock
for await (const it of [Promise.resolve(1), 2, Promise.resolve(3)]) console.log(it); // => 1, 2, 3

await AsyncIterator.from([Promise.resolve(1), 2, Promise.resolve(3)]).toArray(); // => [1, 2, 3]

// but:
await Array.fromAsync([Promise.resolve(1), 2, Promise.resolve(3)]); // => TypeError

image

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