Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zloirock opened this issue Sep 14, 2021 · 1 comment
Closed

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

zloirock opened this issue Sep 14, 2021 · 1 comment

Comments

@zloirock
Copy link
Contributor

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

@js-choi
Copy link
Collaborator

js-choi commented Sep 14, 2021

This is an oversight. Thanks for catching it. I will fix it in the future.

js-choi added a commit that referenced this issue Sep 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants