Removed function in loop

This commit is contained in:
Thomas FORGIONE 2015-07-06 11:26:19 +02:00
parent 80ba3278da
commit c646b54915
3 changed files with 18 additions and 16 deletions

View File

@ -178,13 +178,17 @@ for (var i = 1; i < 26; i++) {
geo.availableMeshes = {};
for (var name in availableMeshNames) {
function pushMesh(name) {
(function(name) {
geo.availableMeshes[name] = new geo.MeshContainer(name.substring(1, name.length), function() {
availableMeshNames[name] = true;
trySetLoaded();
});
})(name);
}
for (var name in availableMeshNames) {
pushMesh(name);
}

View File

@ -349,6 +349,4 @@ utils.Iterator = Iterator;
return utils;
console.log("Hello");
})();

View File

@ -18,16 +18,16 @@ var log;
if (isDev) {
log = function(elt, color) {
console.log(color + elt + Colors.DEFAULT);
}
};
} else {
log = function(elt, color) {
console.log(elt);
}
};
}
Log.ready = function(msg) {
log('[RDY] ' + new Date() + ' ' + msg, Colors.GREEN);
}
};
Log.request = function(req, res) {
if (req.headers['x-forwarded-for'] !== undefined || isDev) {
@ -38,7 +38,7 @@ Log.request = function(req, res) {
Colors.CYAN
);
}
}
};
Log.socket = {};
Log.socket.connection = function(socket) {
@ -47,7 +47,7 @@ Log.socket.connection = function(socket) {
socket.handshake.address + ' connection',
Colors.YELLOW
);
}
};
Log.socket.disconnect = function(socket) {
log(
@ -55,13 +55,13 @@ Log.socket.disconnect = function(socket) {
socket.handshake.address + ' disconnect',
Colors.YELLOW
);
}
};
Log.dberror = function(error) {
log(
'[DBE] ' + new Date() + ' ' + error,
Colors.RED
);
}
};
module.exports = Log;