diff options
author | Gregor Martynus <gregor@martynus.net> | 2015-12-30 17:06:40 +0100 |
---|---|---|
committer | Gregor Martynus <gregor@martynus.net> | 2015-12-30 17:06:40 +0100 |
commit | f360e0d6d21c0fd9942252358d03b223a8ea42e7 (patch) | |
tree | f7cc18fa0c7794ccb3398030593f7e8f2ea01348 /lib | |
parent | f556b202d418c59de8f76e409d82c75b12f5a9ca (diff) | |
download | async-f360e0d6d21c0fd9942252358d03b223a8ea42e7.tar.gz |
fix: auto stops after error #988
Diffstat (limited to 'lib')
-rw-r--r-- | lib/async.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/async.js b/lib/async.js index 3748ac0..9ecbda6 100644 --- a/lib/async.js +++ b/lib/async.js @@ -528,6 +528,8 @@ var results = {}; var runningTasks = 0; + var hasError = false; + var listeners = []; function addListener(fn) { listeners.unshift(fn); @@ -550,6 +552,7 @@ }); _arrayEach(keys, function (k) { + if (hasError) return; var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; var taskCallback = _restParam(function(err, args) { runningTasks--; @@ -562,6 +565,8 @@ safeResults[rkey] = val; }); safeResults[k] = args; + hasError = true; + callback(err, safeResults); } else { |