From: Fedor Indutny Date: Mon, 16 Jan 2012 13:33:16 +0000 (+0600) Subject: Revert "util: always display a warning for module in debug mode" X-Git-Tag: v0.7.0~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03e689fae45ce31282b588f424988f90c9d652bb;p=platform%2Fupstream%2Fnodejs.git Revert "util: always display a warning for module in debug mode" This reverts commit df62005ece4bb0be0d5af645fd9093b1506ce63d. --- 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; - } };