File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function emitWarningIfNeeded(set) {
3333
3434function debuglogImpl ( set ) {
3535 set = set . toUpperCase ( ) ;
36- if ( ! debugs [ set ] ) {
36+ if ( debugs [ set ] === undefined ) {
3737 if ( debugEnvRegex . test ( set ) ) {
3838 const pid = process . pid ;
3939 emitWarningIfNeeded ( set ) ;
@@ -42,7 +42,7 @@ function debuglogImpl(set) {
4242 process . stderr . write ( format ( '%s %d: %s\n' , set , pid , msg ) ) ;
4343 } ;
4444 } else {
45- debugs [ set ] = function debug ( ) { } ;
45+ debugs [ set ] = null ;
4646 }
4747 }
4848 return debugs [ set ] ;
@@ -55,12 +55,13 @@ function debuglogImpl(set) {
5555function debuglog ( set ) {
5656 let debug ;
5757 return function ( ...args ) {
58- if ( ! debug ) {
58+ if ( debug === undefined ) {
5959 // Only invokes debuglogImpl() when the debug function is
6060 // called for the first time.
6161 debug = debuglogImpl ( set ) ;
6262 }
63- debug ( ...args ) ;
63+ if ( debug !== null )
64+ debug ( ...args ) ;
6465 } ;
6566}
6667
You can’t perform that action at this time.
0 commit comments