summaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js31
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/util.js b/lib/util.js
index d3b13066f8..5750159e82 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -407,18 +407,12 @@ function objectToString(o) {
}
-var pWarning;
-
exports.p = function() {
- if (!pWarning) {
- pWarning = 'util.p will be removed in future versions of Node. ' +
- 'Use util.puts(util.inspect()) instead.\n';
- exports.error(pWarning);
- }
for (var i = 0, len = arguments.length; i < len; ++i) {
error(exports.inspect(arguments[i]));
}
};
+module.deprecate('p', 'Use `util.puts(util.inspect())` instead.');
function pad(n) {
@@ -444,15 +438,10 @@ exports.log = function(msg) {
};
-var execWarning;
exports.exec = function() {
- if (!execWarning) {
- execWarning = 'util.exec has moved to the "child_process" module.' +
- ' Please update your source code.';
- error(execWarning);
- }
return require('child_process').exec.apply(this, arguments);
};
+module.deprecate('exec', 'It is now called `child_process.exec`.');
exports.pump = function(readStream, writeStream, callback) {
@@ -517,19 +506,3 @@ 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))
- console.trace(message);
- else
- console.error(message);
-};