Skip to content

Commit

Permalink
Merge pull request sequelize#1008 from mickhansen/fix-done-args
Browse files Browse the repository at this point in the history
Refactor done() to apply args given, so as not to allways call with 2nd ...
  • Loading branch information
janmeier committed Oct 22, 2013
2 parents d4d2f7b + 916d52f commit 3f2018c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/emitters/custom-event-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ module.exports = (function() {
function(fct) {
fct = bindToProcess(fct);
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
}

Expand Down

0 comments on commit 3f2018c

Please sign in to comment.