feature(util) rm retFunc

This commit is contained in:
coderaiser 2014-02-03 04:16:01 -05:00
parent 37c952b56a
commit e20c5de5fc
5 changed files with 6 additions and 18 deletions

View file

@ -27,7 +27,7 @@ var CloudCmd, Util, DOM, CloudFunc, io;
function init(callback) {
DOM.jsload('/socket.io/lib/socket.io.js', {
onerror : Util.retFunc(Util.log, ERROR_MSG),
onerror : Util.log.bind(Util, ERROR_MSG),
onload : function() {
Util.exec(callback);

View file

@ -58,7 +58,7 @@
path : p.path
},
fill = Util.retFunc(fillJSON, filesData);
fill = fillJSON.bind(null, filesData);
if (n)
for (i = 0; i < n; i++) {

View file

@ -79,7 +79,7 @@
Clients[ConNum] = true;
onMessage = getOnMessage(ConNum, callback);
onDisconnect = Util.retFunc(function(conNum) {
onDisconnect = function(conNum) {
Clients[conNum] =
ClientFuncs[conNum] = null;
@ -87,7 +87,7 @@
socket.removeListener('message', onMessage, clientSocket);
socket.removeListener('disconnect', onDisconnect, clientSocket);
}, ConNum);
}.bind(null, ConNum);
socket.on('message', onMessage, clientSocket);
socket.on('disconnect', onDisconnect, clientSocket);

View file

@ -79,7 +79,7 @@
for (var i = 0; i < n; i++) {
lDirPath = path.join(lPath, pFiles[i]);
process.nextTick(Util.retFunc(getDirInfo, lDirPath));
process.nextTick(getDirInfo.bind(null, lDirPath));
}
}

View file

@ -441,7 +441,7 @@
* @param pArg
*/
this.log = function() {
var args = Util.slice(arguments),
var args = this.slice(arguments),
console = Scope.console,
lDate = '[' + Util.getDate() + '] ';
@ -760,18 +760,6 @@
Util.exec.apply(null, argsLocal);
};
};
/**
* return function wich exec function in params
* @param arguments: callback, args
*/
this.retFunc = function() {
var args = arguments;
return function() {
return Util.exec.apply(null, args);
};
};
/**
* function return false