From 2027f8b72c2c6d5c17fd2cc7e639a405c800e82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20V=C3=A4h=C3=A4kotam=C3=A4ki?= Date: Wed, 18 Jun 2014 00:35:42 +0300 Subject: [PATCH] fixed issue #557 from upstream --- lib/async.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/async.js b/lib/async.js index a13f83520..61184ef91 100755 --- a/lib/async.js +++ b/lib/async.js @@ -121,6 +121,7 @@ return callback(); } var completed = 0; + var arr_length = arr.length; _each(arr, function (x) { iterator(x, only_once(done) ); }); @@ -131,7 +132,7 @@ } else { completed += 1; - if (completed >= arr.length) { + if (completed >= arr_length) { callback(); } }