Permalink
Browse files

internal/util: remove printDeprecationWarning

Removes the internal/util printDeprecationWarning method

PR-URL: #8166
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information...
jasnell committed Aug 18, 2016
1 parent b50557b commit 7b73f559029a10474b74a83bfb1117ab512785d4
Showing with 3 additions and 14 deletions.
  1. +0 −10 lib/internal/util.js
  2. +3 −4 test/parallel/test-process-no-deprecation.js
@@ -19,16 +19,6 @@ exports.deprecate = function(fn, msg) {
return exports._deprecate(fn, msg);
};
// All the internal deprecations have to use this function only, as this will
// prepend the prefix to the actual message.
exports.printDeprecationMessage = function(msg, warned, ctor) {
if (warned || process.noDeprecation)
return true;
process.emitWarning(msg, 'DeprecationWarning',
ctor || exports.printDeprecationMessage);
return true;
};
exports.error = function(msg) {
const fmt = `${prefix}${msg}`;
if (arguments.length > 1) {
@@ -1,5 +1,5 @@
'use strict';
// Flags: --expose_internals --no-warnings
// Flags: --no-warnings
// The --no-warnings flag only supresses writing the warning to stderr, not the
// emission of the corresponding event. This test file can be run without it.
@@ -15,8 +15,7 @@ function listener() {
process.addListener('warning', listener);
const internalUtil = require('internal/util');
internalUtil.printDeprecationMessage('Something is deprecated.');
process.emitWarning('Something is deprecated.', 'DeprecationWarning');
// The warning would be emitted in the next tick, so continue after that.
process.nextTick(common.mustCall(() => {
@@ -29,5 +28,5 @@ process.nextTick(common.mustCall(() => {
assert.strictEqual(warning.message, 'Something else is deprecated.');
}));
internalUtil.printDeprecationMessage('Something else is deprecated.');
process.emitWarning('Something else is deprecated.', 'DeprecationWarning');
}));

0 comments on commit 7b73f55

Please sign in to comment.