diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-16 17:33:16 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-16 17:33:16 +0400 |
commit | 03e689fae45ce31282b588f424988f90c9d652bb (patch) | |
tree | 4ea24b4a7a95990b682803e8394f71d082951627 /lib | |
parent | df62005ece4bb0be0d5af645fd9093b1506ce63d (diff) |
Revert "util: always display a warning for module in debug mode"
This reverts commit df62005ece4bb0be0d5af645fd9093b1506ce63d.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/util.js b/lib/util.js index 834dc676ee2..8cc4739f275 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; - } }; |