Permalink
Browse files

make join() properly reset state after completing

  • Loading branch information...
1 parent 1f44d79 commit a69e8742d4e4cb05d9d670ef760636811de4778e @jmar777 committed Nov 21, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/suspend.js
View
@@ -187,6 +187,11 @@ Suspender.prototype.join = function join() {
results[i] = forkValue[1];
}
}
+ // reset fork/join state
+ this.pendingJoin = false;
+ this.pendingForks = 0;
+ this.forkValues.length = 0;
+ // resume the generator with our fork/join results
this.resume(err, results);
};

0 comments on commit a69e874

Please sign in to comment.