summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregor Martynus <gregor@martynus.net>2015-12-30 17:06:40 +0100
committerGregor Martynus <gregor@martynus.net>2015-12-30 17:06:40 +0100
commitf360e0d6d21c0fd9942252358d03b223a8ea42e7 (patch)
treef7cc18fa0c7794ccb3398030593f7e8f2ea01348 /lib
parentf556b202d418c59de8f76e409d82c75b12f5a9ca (diff)
downloadasync-f360e0d6d21c0fd9942252358d03b223a8ea42e7.tar.gz
fix: auto stops after error #988
Diffstat (limited to 'lib')
-rw-r--r--lib/async.js5
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 {