File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,6 @@ exports.deprecate = function(fn, msg) {
1919 return exports . _deprecate ( fn , msg ) ;
2020} ;
2121
22- // All the internal deprecations have to use this function only, as this will
23- // prepend the prefix to the actual message.
24- exports . printDeprecationMessage = function ( msg , warned , ctor ) {
25- if ( warned || process . noDeprecation )
26- return true ;
27- process . emitWarning ( msg , 'DeprecationWarning' ,
28- ctor || exports . printDeprecationMessage ) ;
29- return true ;
30- } ;
31-
3222exports . error = function ( msg ) {
3323 const fmt = `${ prefix } ${ msg } ` ;
3424 if ( arguments . length > 1 ) {
Original file line number Diff line number Diff line change 11'use strict' ;
2- // Flags: --expose_internals -- no-warnings
2+ // Flags: --no-warnings
33
44// The --no-warnings flag only supresses writing the warning to stderr, not the
55// emission of the corresponding event. This test file can be run without it.
@@ -15,8 +15,7 @@ function listener() {
1515
1616process . addListener ( 'warning' , listener ) ;
1717
18- const internalUtil = require ( 'internal/util' ) ;
19- internalUtil . printDeprecationMessage ( 'Something is deprecated.' ) ;
18+ process . emitWarning ( 'Something is deprecated.' , 'DeprecationWarning' ) ;
2019
2120// The warning would be emitted in the next tick, so continue after that.
2221process . nextTick ( common . mustCall ( ( ) => {
@@ -29,5 +28,5 @@ process.nextTick(common.mustCall(() => {
2928 assert . strictEqual ( warning . message , 'Something else is deprecated.' ) ;
3029 } ) ) ;
3130
32- internalUtil . printDeprecationMessage ( 'Something else is deprecated.' ) ;
31+ process . emitWarning ( 'Something else is deprecated.' , 'DeprecationWarning ') ;
3332} ) ) ;
You can’t perform that action at this time.
0 commit comments