@@ -133,6 +133,7 @@ function pad(value) {
133133const kNone = 1 << 0 ;
134134const kSkipLog = 1 << 1 ;
135135const kSkipTrace = 1 << 2 ;
136+ const kShouldSkipAll = kSkipLog | kSkipTrace ;
136137
137138const kSecond = 1000 ;
138139const kMinute = 60 * kSecond ;
@@ -377,8 +378,6 @@ function debugWithTimer(set, cb) {
377378 let debugLogCategoryEnabled = false ;
378379 let timerFlags = kNone ;
379380
380- const skipAll = kSkipLog | kSkipTrace ;
381-
382381 function ensureTimerFlagsAreUpdated ( ) {
383382 timerFlags &= ~ kSkipTrace ;
384383
@@ -393,7 +392,7 @@ function debugWithTimer(set, cb) {
393392 function internalStartTimer ( logLabel , traceLabel ) {
394393 ensureTimerFlagsAreUpdated ( ) ;
395394
396- if ( timerFlags === skipAll ) {
395+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
397396 return ;
398397 }
399398
@@ -413,7 +412,7 @@ function debugWithTimer(set, cb) {
413412 function internalEndTimer ( logLabel , traceLabel ) {
414413 ensureTimerFlagsAreUpdated ( ) ;
415414
416- if ( timerFlags === skipAll ) {
415+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
417416 return ;
418417 }
419418
@@ -434,7 +433,7 @@ function debugWithTimer(set, cb) {
434433 function internalLogTimer ( logLabel , traceLabel , args ) {
435434 ensureTimerFlagsAreUpdated ( ) ;
436435
437- if ( timerFlags === skipAll ) {
436+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
438437 return ;
439438 }
440439
@@ -477,7 +476,7 @@ function debugWithTimer(set, cb) {
477476 const startTimer = ( logLabel , traceLabel ) => {
478477 init ( ) ;
479478
480- if ( timerFlags !== skipAll )
479+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
481480 internalStartTimer ( logLabel , traceLabel ) ;
482481 } ;
483482
@@ -487,7 +486,7 @@ function debugWithTimer(set, cb) {
487486 const endTimer = ( logLabel , traceLabel ) => {
488487 init ( ) ;
489488
490- if ( timerFlags !== skipAll )
489+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
491490 internalEndTimer ( logLabel , traceLabel ) ;
492491 } ;
493492
@@ -497,7 +496,7 @@ function debugWithTimer(set, cb) {
497496 const logTimer = ( logLabel , traceLabel , args ) => {
498497 init ( ) ;
499498
500- if ( timerFlags !== skipAll )
499+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
501500 internalLogTimer ( logLabel , traceLabel , args ) ;
502501 } ;
503502
0 commit comments