瀏覽代碼

Merge pull request #78 from connor4312/master

Don't leak arguments
Jake 10 年之前
父節點
當前提交
32c3ece12d
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      modules/logging.js

+ 5 - 2
modules/logging.js

@@ -4,7 +4,10 @@ var exp = {};
 
 function log() {
   var time = new Date().toISOString();
-  var text = Array.prototype.slice.call(arguments).join(" ");
+  var text = '';
+  for (var i = 0, l = arguments.length; i < l; i++) {
+    text += ' ' + arguments[i];
+  }
   console.log(time + ": " + text);
 }
 
@@ -17,4 +20,4 @@ if (config.debug_enabled) {
   exp.debug = function(){};
 }
 
-module.exports = exp;
+module.exports = exp;