File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ Console.prototype.timeEnd = function(label) {
68
68
const duration = process . hrtime ( time ) ;
69
69
const ms = duration [ 0 ] * 1000 + duration [ 1 ] / 1e6 ;
70
70
this . log ( '%s: %sms' , label , ms . toFixed ( 3 ) ) ;
71
+ this . _times . delete ( label ) ;
71
72
} ;
72
73
73
74
Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ console.timeEnd('hasOwnProperty');
57
57
58
58
global . process . stdout . write = stdout_write ;
59
59
60
+ // verify that console.timeEnd() doesn't leave dead links
61
+ const timesMapSize = console . _times . size ;
62
+ console . time ( 'label1' ) ;
63
+ console . time ( 'label2' ) ;
64
+ console . time ( 'label3' ) ;
65
+ console . timeEnd ( 'label1' ) ;
66
+ console . timeEnd ( 'label2' ) ;
67
+ console . timeEnd ( 'label3' ) ;
68
+ assert . strictEqual ( console . _times . size , timesMapSize ) ;
69
+
60
70
assert . equal ( 'foo\n' , strings . shift ( ) ) ;
61
71
assert . equal ( 'foo bar\n' , strings . shift ( ) ) ;
62
72
assert . equal ( 'foo bar hop\n' , strings . shift ( ) ) ;
You can’t perform that action at this time.
0 commit comments