mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(util) exec.with: callback.bind -> bind.apply
This commit is contained in:
parent
bd5ae84ba9
commit
0020afcf92
1 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue