From: Maciej MaƂecki Date: Mon, 16 Jan 2012 12:54:35 +0000 (+0100) Subject: util: always display a warning for module in debug mode X-Git-Tag: v0.7.0~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df62005ece4bb0be0d5af645fd9093b1506ce63d;p=platform%2Fupstream%2Fnodejs.git util: always display a warning for module in debug mode --- diff --git a/lib/util.js b/lib/util.js index 8cc4739..834dc67 100644 --- a/lib/util.js +++ b/lib/util.js @@ -522,15 +522,16 @@ exports.inherits = function(ctor, superCtor) { var deprecationWarnings; exports._deprecationWarning = function(moduleId, message) { - if (!deprecationWarnings) - deprecationWarnings = {}; - else if (message in deprecationWarnings) - return; - - deprecationWarnings[message] = true; - - if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG)) + if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG)) { console.trace(message); - else + } else { + if (!deprecationWarnings) { + deprecationWarnings = {}; + } else if (message in deprecationWarnings) { + return; + } console.error(message); + + deprecationWarnings[message] = true; + } };