diff --git a/lib/util.js b/lib/util.js index 353f86bc..430e556b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -271,11 +271,13 @@ /* * return function that calls callback with arguments */ - exec.with = function(callback) { - var args = [].slice.call(arguments, 1); + var args = [].slice.call(arguments), + bind = Function.prototype.bind; - return callback.bind(null, args); + args[0] = null; + + return bind.apply(callback, args); }; /**