不要怂,就是干,撸起袖子干!

Commit 3f2018c0 by Jan Aagaard Meier

Merge pull request #1008 from mickhansen/fix-done-args

Refactor done() to apply args given, so as not to allways call with 2nd ...
2 parents d4d2f7be 916d52f2
Showing with 5 additions and 1 deletions
...@@ -49,7 +49,11 @@ module.exports = (function() { ...@@ -49,7 +49,11 @@ module.exports = (function() {
function(fct) { function(fct) {
fct = bindToProcess(fct); fct = bindToProcess(fct);
this.on('error', function(err) { fct(err, null) }) this.on('error', function(err) { fct(err, null) })
.on('success', function(arg0, arg1) { fct(null, arg0, arg1) }) .on('success', function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(null);
fct.apply(fct, args);
})
return this return this
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!