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

Defense for eached array alteration, fixes #557 #558

Conversation

amv
Copy link

@amv amv commented Jun 17, 2014

Altering the array of iterables after calling each on the array makes async either call the callback several times or not call the callback at all (depending on wether you add or remove array items).

Although it is probably not a very good practise to alter the array while it is being iterated with each, sometimes the array is passed on and the person receiving the array does not know that such requirement is in place.

The current async behaviour in such situations is very problematic and this commit should fix the problems. This should fix #557 .

@aearly aearly added the bug label May 21, 2015
aearly pushed a commit that referenced this pull request Jun 1, 2015
@aearly
Copy link
Collaborator

aearly commented Jun 1, 2015

This was fixed as side effects of other changes.

@aearly aearly closed this Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

async.each callback could be called more than once when array is modified
2 participants