-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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.each callback called multiple times if result is unshifted #932
Comments
Thanks for the bug report! 🐛 I think i know what's going on here. |
I have not found this to be a bug |
I should have mentioned that my workaround is to clone |
@youqingkui You ran the snippet I posted and did not see "done" printed an infinite number of times? If so, what versions of node and async are you using? |
@guyellis I use node is v4.0.0, async is 1.4.2 var async = require('async');
function func(done) {
var arr = ['a'];
async.each(arr, function(item, callback){
return callback();
}, function() {
console.log('done');
return done(arr);
});
}
func(function(arr) {
console.log(arr);
arr.unshift('a');
//arr.shift('a');nod
console.log(arr);
});
// done
// [ 'a' ]
// [ 'a', 'a' ] |
@youqingkui You're right. The project that I'm working on has a very out-of-date version of async. Looks like it's my problem. Thanks for pointing this out! :) |
I expect this issue is closely related to #557 and #572
"done" is printed an infinite number of times.
async version: 0.9.2
node version 0.12.7
The text was updated successfully, but these errors were encountered: