feature(util) exec.with: callback.bind -> bind.apply

This commit is contained in:
coderaiser 2015-06-05 09:47:06 -04:00
parent bd5ae84ba9
commit 0020afcf92

View file

@ -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);
};
/**