summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/async.js2
-rwxr-xr-xtest/test-async.js8
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/async.js b/lib/async.js
index 08af693..3748ac0 100644
--- a/lib/async.js
+++ b/lib/async.js
@@ -510,7 +510,7 @@
};
async.auto = function (tasks, concurrency, callback) {
- if (!callback) {
+ if (typeof arguments[1] === 'function') {
// concurrency is optional, shift the args.
callback = concurrency;
concurrency = null;
diff --git a/test/test-async.js b/test/test-async.js
index 6cce049..ee0b950 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -426,7 +426,6 @@ exports['auto results'] = function(test){
});
};
-
exports['auto empty object'] = function(test){
async.auto({}, function(err){
test.ok(err === null, err + " passed instead of 'null'");
@@ -461,6 +460,13 @@ exports['auto no callback'] = function(test){
});
};
+exports['auto concurrency no callback'] = function(test){
+ async.auto({
+ task1: function(callback){callback();},
+ task2: ['task1', function(callback){callback(); test.done();}]
+ }, 1);
+};
+
exports['auto error should pass partial results'] = function(test) {
async.auto({
task1: function(callback){