Permalink
Browse files

refactor arg of forEach

  • Loading branch information...
1 parent ae00331 commit 7395fb79fc0ccf713c44b4b005d3411e54d0d515 @tasogarepg committed Mar 18, 2012
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/node-block.js
View
@@ -14,21 +14,20 @@ function BlockInfo(funcs) {
this.cat = null;
this.fin = null;
this.cb = null;
- var that = this;
funcs.forEach(function(func) {
- var step = new StepInfo(that, that.stepList.length, func);
- that.stepList.push(step);
+ var step = new StepInfo(this, this.stepList.length, func);
+ this.stepList.push(step);
if (func.name == 'cat') {
- that.cat = step;
+ this.cat = step;
that.cat.func = function(err, data) {
if (!err) return;
func(err, data);
this.errBaton = null;
};
} else if (func.name == 'fin') {
- that.fin = step;
+ this.fin = step;
}
- });
+ }, this);
}
BlockInfo.prototype.start = function(cb) {

0 comments on commit 7395fb7

Please sign in to comment.