File tree 2 files changed +3
-14
lines changed
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) {
19
19
return exports . _deprecate ( fn , msg ) ;
20
20
} ;
21
21
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
-
32
22
exports . error = function ( msg ) {
33
23
const fmt = `${ prefix } ${ msg } ` ;
34
24
if ( arguments . length > 1 ) {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
- // Flags: --expose_internals -- no-warnings
2
+ // Flags: --no-warnings
3
3
4
4
// The --no-warnings flag only supresses writing the warning to stderr, not the
5
5
// emission of the corresponding event. This test file can be run without it.
@@ -15,8 +15,7 @@ function listener() {
15
15
16
16
process . addListener ( 'warning' , listener ) ;
17
17
18
- const internalUtil = require ( 'internal/util' ) ;
19
- internalUtil . printDeprecationMessage ( 'Something is deprecated.' ) ;
18
+ process . emitWarning ( 'Something is deprecated.' , 'DeprecationWarning' ) ;
20
19
21
20
// The warning would be emitted in the next tick, so continue after that.
22
21
process . nextTick ( common . mustCall ( ( ) => {
@@ -29,5 +28,5 @@ process.nextTick(common.mustCall(() => {
29
28
assert . strictEqual ( warning . message , 'Something else is deprecated.' ) ;
30
29
} ) ) ;
31
30
32
- internalUtil . printDeprecationMessage ( 'Something else is deprecated.' ) ;
31
+ process . emitWarning ( 'Something else is deprecated.' , 'DeprecationWarning ') ;
33
32
} ) ) ;
You can’t perform that action at this time.
0 commit comments