refactor(util) retExec, add bind

This commit is contained in:
coderaiser 2014-02-12 04:59:34 -05:00
parent 97567e984e
commit 87bd317f64

View file

@ -55,6 +55,17 @@
}
},
this.bind = function(callback) {
var result,
args = Util.slice(arguments, 1),
bind = Function.prototype.bind;
args.unshift(null);
result = bind.apply(callback, args);
return result;
};
/**
* ad new line (if it's not)
* @param {string} pText
@ -710,17 +721,13 @@
* return save exec function
* @param callback
*/
this.retExec = function(callback) {
var args = Util.slice(arguments);
this.retExec = function() {
var result,
exec = Util.exec.bind(Util);
return function() {
var argsLocal = Util.slice(arguments);
callback;
argsLocal = args.concat(argsLocal);
Util.exec.apply(null, argsLocal);
};
result = Util.bind.apply(exec, arguments);
return result;
};
/**