33const {
44 ArrayPrototypeJoin,
55 SafeSet,
6- Symbol,
76} = primordials ;
87
98const { hasTracing } = internalBinding ( 'config' ) ;
10- const kHandle = Symbol ( 'handle' ) ;
11- const kEnabled = Symbol ( 'enabled' ) ;
12- const kCategories = Symbol ( 'categories' ) ;
139
1410const kMaxTracingCount = 10 ;
1511
@@ -33,16 +29,19 @@ const {
3329const enabledTracingObjects = new SafeSet ( ) ;
3430
3531class Tracing {
32+ #handle;
33+ #categories;
34+ #enabled = false ;
35+
3636 constructor ( categories ) {
37- this [ kHandle ] = new CategorySet ( categories ) ;
38- this [ kCategories ] = categories ;
39- this [ kEnabled ] = false ;
37+ this . #handle = new CategorySet ( categories ) ;
38+ this . #categories = categories ;
4039 }
4140
4241 enable ( ) {
43- if ( ! this [ kEnabled ] ) {
44- this [ kEnabled ] = true ;
45- this [ kHandle ] . enable ( ) ;
42+ if ( ! this . #enabled ) {
43+ this . #enabled = true ;
44+ this . #handle . enable ( ) ;
4645 enabledTracingObjects . add ( this ) ;
4746 if ( enabledTracingObjects . size > kMaxTracingCount ) {
4847 process . emitWarning (
@@ -54,19 +53,19 @@ class Tracing {
5453 }
5554
5655 disable ( ) {
57- if ( this [ kEnabled ] ) {
58- this [ kEnabled ] = false ;
59- this [ kHandle ] . disable ( ) ;
56+ if ( this . #enabled ) {
57+ this . #enabled = false ;
58+ this . #handle . disable ( ) ;
6059 enabledTracingObjects . delete ( this ) ;
6160 }
6261 }
6362
6463 get enabled ( ) {
65- return this [ kEnabled ] ;
64+ return this . #enabled ;
6665 }
6766
6867 get categories ( ) {
69- return ArrayPrototypeJoin ( this [ kCategories ] , ',' ) ;
68+ return ArrayPrototypeJoin ( this . #categories , ',' ) ;
7069 }
7170
7271 [ customInspectSymbol ] ( depth , opts ) {
0 commit comments