File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,10 @@ class GCProfiler {
488488 return JSONParse ( data ) ;
489489 }
490490 }
491+
492+ [ SymbolDispose ] ( ) {
493+ this . stop ( ) ;
494+ }
491495}
492496
493497module . exports = {
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+ const { GCProfiler } = require ( 'v8' ) ;
6+
7+ {
8+ const profiler = new GCProfiler ( ) ;
9+ profiler . start ( ) ;
10+
11+ const result = profiler [ Symbol . dispose ] ( ) ;
12+
13+ assert . strictEqual ( result , undefined ) ;
14+ assert . strictEqual ( profiler . stop ( ) , undefined ) ;
15+ }
16+
17+ {
18+ const profiler = new GCProfiler ( ) ;
19+ profiler . start ( ) ;
20+
21+ profiler [ Symbol . dispose ] ( ) ;
22+ // Repeat invocations should not throw
23+ profiler [ Symbol . dispose ] ( ) ;
24+
25+ assert . strictEqual ( profiler . stop ( ) , undefined ) ;
26+ }
You can’t perform that action at this time.
0 commit comments