Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug fix for next.parallel. Sometimes didn't reset values.

  • Loading branch information...
commit 72fa1683fc403bf58d9e24eaf3d7d91b251b912c 1 parent d9a1ceb
@tim-smart authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  lib/parallel/index.js
  2. +1 −1  package.json
View
3  lib/parallel/index.js
@@ -82,6 +82,8 @@ Sequence.prototype.add = function add() {
Sequence.prototype.run = function run(callback) {
var tasks = this._tasks.slice();
var next = function next() {
+ counter = 0; results = []; error = null;
+
var task = tasks.shift();
if (typeof task !== 'function') {
return callback ? callback.apply(this, arguments) : null;
@@ -110,7 +112,6 @@ Sequence.prototype.run = function run(callback) {
results.unshift(results.slice());
results.unshift(error);
next.apply(null, results);
- counter = 0; results = []; error = null;
}
};
});
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "parallel",
"description": "Create tasks in node.js that run in parallel, or sequences that run tasks one after another.",
- "version": "0.1.2",
+ "version": "0.1.3",
"author": "Tim Smart",
"repository": {
"type": "git",
Please sign in to comment.
Something went wrong with that request. Please try again.