Skip to content

Commit 5a9383b

Browse files
committed
update minified build
1 parent 94868a2 commit 5a9383b

File tree

6 files changed

+28
-25
lines changed

6 files changed

+28
-25
lines changed

bower.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,5 @@
5252
],
5353
"authors": [
5454
"Caolan McMahon"
55-
],
56-
"version": "1.5.0"
57-
}
55+
]
56+
}

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"scripts": [
1515
"lib/async.js"
1616
]
17-
}
17+
}

dist/async.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@
510510
};
511511

512512
async.auto = function (tasks, concurrency, callback) {
513-
if (!callback) {
513+
if (typeof arguments[1] === 'function') {
514514
// concurrency is optional, shift the args.
515515
callback = concurrency;
516516
concurrency = null;
@@ -528,6 +528,8 @@
528528
var results = {};
529529
var runningTasks = 0;
530530

531+
var hasError = false;
532+
531533
var listeners = [];
532534
function addListener(fn) {
533535
listeners.unshift(fn);
@@ -550,6 +552,7 @@
550552
});
551553

552554
_arrayEach(keys, function (k) {
555+
if (hasError) return;
553556
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
554557
var taskCallback = _restParam(function(err, args) {
555558
runningTasks--;
@@ -562,6 +565,8 @@
562565
safeResults[rkey] = val;
563566
});
564567
safeResults[k] = args;
568+
hasError = true;
569+
565570
callback(err, safeResults);
566571
}
567572
else {
@@ -781,7 +786,7 @@
781786
} else if (test.apply(this, args)) {
782787
iterator(next);
783788
} else {
784-
callback(null);
789+
callback.apply(null, [null].concat(args));
785790
}
786791
});
787792
iterator(next);
@@ -929,24 +934,23 @@
929934
_insert(q, data, true, callback);
930935
},
931936
process: function () {
932-
if (!q.paused && workers < q.concurrency && q.tasks.length) {
933-
while(workers < q.concurrency && q.tasks.length){
934-
var tasks = q.payload ?
935-
q.tasks.splice(0, q.payload) :
936-
q.tasks.splice(0, q.tasks.length);
937-
938-
var data = _map(tasks, function (task) {
939-
return task.data;
940-
});
937+
while(!q.paused && workers < q.concurrency && q.tasks.length){
941938

942-
if (q.tasks.length === 0) {
943-
q.empty();
944-
}
945-
workers += 1;
946-
workersList.push(tasks[0]);
947-
var cb = only_once(_next(q, tasks));
948-
worker(data, cb);
939+
var tasks = q.payload ?
940+
q.tasks.splice(0, q.payload) :
941+
q.tasks.splice(0, q.tasks.length);
942+
943+
var data = _map(tasks, function (task) {
944+
return task.data;
945+
});
946+
947+
if (q.tasks.length === 0) {
948+
q.empty();
949949
}
950+
workers += 1;
951+
workersList.push(tasks[0]);
952+
var cb = only_once(_next(q, tasks));
953+
worker(data, cb);
950954
}
951955
},
952956
length: function () {

dist/async.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/async.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@
8282
"tests"
8383
]
8484
}
85-
}
85+
}

0 commit comments

Comments
 (0)