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

Async Whilst errors if test() gets false before iteration starts #1626

Closed
blockwooddev opened this issue Feb 19, 2019 · 0 comments
Closed

Async Whilst errors if test() gets false before iteration starts #1626

blockwooddev opened this issue Feb 19, 2019 · 0 comments
Labels

Comments

@blockwooddev
Copy link

What version of async are you using?
3.0.1-0

Which environment did the issue occur in (Node version/browser version)
node 8.9.4

What did you do? Please include a minimal reproducable case illustrating issue.
Used async whilst in a case where the test was false on the first try, before calling the iterator.

What did you expect to happen?
After the test is called, I expected to go to callback()

What was the actual result?
Error: undefined is not iterable

From looking at the code, it looks like whilst tries to call spread on result on line 55 if the truth is false. Since next() hasn't been called yet (and won't be called), result is still undefined, so spread gets called on undefined, and the error occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants