Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure parallel task return in order

  • Loading branch information...
commit 12dd098f762a5e8829482be5c1eb835b5d30eefe 1 parent 2a3c55e
@tim-smart authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/parallel/index.js
View
3  lib/parallel/index.js
@@ -98,12 +98,13 @@ Sequence.prototype.run = function run(callback) {
results = [],
error = null;
next.parallel = function parallel() {
- counter++;
+ var i = counter++;
return function () {
if (arguments[0]) {
error = arguments[0];
}
results.push(arguments[1]);
+ results[i + 1] = arguments[1];
counter--;
if (counter <= 0) {
results.unshift(results.slice());
Please sign in to comment.
Something went wrong with that request. Please try again.