From 03e689fae45ce31282b588f424988f90c9d652bb Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Mon, 16 Jan 2012 19:33:16 +0600 Subject: [PATCH] Revert "util: always display a warning for module in debug mode" This reverts commit df62005ece4bb0be0d5af645fd9093b1506ce63d. --- lib/util.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/util.js b/lib/util.js index 834dc67..8cc4739 100644 --- a/lib/util.js +++ b/lib/util.js @@ -522,16 +522,15 @@ exports.inherits = function(ctor, superCtor) { var deprecationWarnings; exports._deprecationWarning = function(moduleId, message) { - if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG)) { + if (!deprecationWarnings) + deprecationWarnings = {}; + else if (message in deprecationWarnings) + return; + + deprecationWarnings[message] = true; + + if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG)) console.trace(message); - } else { - if (!deprecationWarnings) { - deprecationWarnings = {}; - } else if (message in deprecationWarnings) { - return; - } + else console.error(message); - - deprecationWarnings[message] = true; - } }; -- 2.7.4