Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: Remove p, has been deprecated for years #3432

Merged
merged 1 commit into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,6 @@ function hasOwnProperty(obj, prop) {

// Deprecated old stuff.

exports.p = internalUtil.deprecate(function() {
for (var i = 0, len = arguments.length; i < len; ++i) {
console.error(exports.inspect(arguments[i]));
}
}, 'util.p is deprecated. Use console.error instead.');


exports.exec = internalUtil.deprecate(function() {
return require('child_process').exec.apply(this, arguments);
}, 'util.exec is deprecated. Use child_process.exec instead.');
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/deprecated.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require('util').p('This is deprecated');
require('util').debug('This is deprecated');
10 changes: 5 additions & 5 deletions test/sequential/test-deprecation-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ execFile(node, normal, function(er, stdout, stderr) {
console.error('normal: show deprecation warning');
assert.equal(er, null);
assert.equal(stdout, '');
assert.equal(stderr, '(node) util.p is deprecated. Use console.error ' +
'instead.\n\'This is deprecated\'\n');
assert.equal(stderr, '(node) util.debug is deprecated. Use console.error ' +
'instead.\nDEBUG: This is deprecated\n');
console.log('normal ok');
});

execFile(node, noDep, function(er, stdout, stderr) {
console.error('--no-deprecation: silence deprecations');
assert.equal(er, null);
assert.equal(stdout, '');
assert.equal(stderr, '\'This is deprecated\'\n');
assert.equal(stderr, 'DEBUG: This is deprecated\n');
console.log('silent ok');
});

Expand All @@ -36,8 +36,8 @@ execFile(node, traceDep, function(er, stdout, stderr) {
var stack = stderr.trim().split('\n');
// just check the top and bottom.
assert.equal(stack[0],
'Trace: util.p is deprecated. Use console.error instead.');
assert.equal(stack.pop(), '\'This is deprecated\'');
'Trace: util.debug is deprecated. Use console.error instead.');
assert.equal(stack.pop(), 'DEBUG: This is deprecated');
console.log('trace ok');
});

Expand Down