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;
- }
};