From 6e5e31548b30e8a01ba15e8e02f76b963d41e614 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 1 Feb 2012 12:19:07 -0800 Subject: [PATCH] moar refactoring --- debug.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/debug.js b/debug.js index 1c2189e..d65a9f7 100644 --- a/debug.js +++ b/debug.js @@ -16,7 +16,7 @@ function debug(name) { if (!debug.enabled(name)) return function(){}; - function plain(fmt) { + return function(fmt){ var curr = new Date; var ms = curr - (debug[name] || curr); debug[name] = curr; @@ -27,12 +27,12 @@ function debug(name) { + ' ' + debug.pad(ms, 40 - fmt.length) + 'ms'; - // This hackery is required for IE8, where `console.log` doesn't have 'apply' - window.console && console.log && - Function.prototype.apply.call(console.log, console, arguments); + // This hackery is required for IE8 + // where `console.log` doesn't have 'apply' + window.console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); } - - return plain; } /**