diff --git a/lib/async.js b/lib/async.js index 08af69396..3748ac070 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 6cce049d5..ee0b950d6 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){