File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function emitWarningIfNeeded(set) {
33
33
34
34
function debuglogImpl ( set ) {
35
35
set = set . toUpperCase ( ) ;
36
- if ( ! debugs [ set ] ) {
36
+ if ( debugs [ set ] === undefined ) {
37
37
if ( debugEnvRegex . test ( set ) ) {
38
38
const pid = process . pid ;
39
39
emitWarningIfNeeded ( set ) ;
@@ -42,7 +42,7 @@ function debuglogImpl(set) {
42
42
process . stderr . write ( format ( '%s %d: %s\n' , set , pid , msg ) ) ;
43
43
} ;
44
44
} else {
45
- debugs [ set ] = function debug ( ) { } ;
45
+ debugs [ set ] = null ;
46
46
}
47
47
}
48
48
return debugs [ set ] ;
@@ -55,12 +55,13 @@ function debuglogImpl(set) {
55
55
function debuglog ( set ) {
56
56
let debug ;
57
57
return function ( ...args ) {
58
- if ( ! debug ) {
58
+ if ( debug === undefined ) {
59
59
// Only invokes debuglogImpl() when the debug function is
60
60
// called for the first time.
61
61
debug = debuglogImpl ( set ) ;
62
62
}
63
- debug ( ...args ) ;
63
+ if ( debug !== null )
64
+ debug ( ...args ) ;
64
65
} ;
65
66
}
66
67
You can’t perform that action at this time.
0 commit comments