File tree 3 files changed +16
-10
lines changed
3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 18
18
/* global isMainThread */
19
19
20
20
const {
21
- _setupTraceCategoryState,
22
21
_setupNextTick,
23
22
_setupPromises
24
23
} = bootstrappers ;
@@ -431,7 +430,10 @@ function readAndExecuteStdin() {
431
430
}
432
431
433
432
function setupTraceCategoryState ( ) {
434
- const { traceCategoryState } = internalBinding ( 'trace_events' ) ;
433
+ const {
434
+ traceCategoryState,
435
+ setTraceCategoryStateUpdateHandler
436
+ } = internalBinding ( 'trace_events' ) ;
435
437
const kCategoryAsyncHooks = 0 ;
436
438
let traceEventsAsyncHook ;
437
439
@@ -453,7 +455,7 @@ function setupTraceCategoryState() {
453
455
}
454
456
455
457
toggleTraceCategoryState ( ) ;
456
- _setupTraceCategoryState ( toggleTraceCategoryState ) ;
458
+ setTraceCategoryStateUpdateHandler ( toggleTraceCategoryState ) ;
457
459
}
458
460
459
461
function setupProcessObject ( ) {
Original file line number Diff line number Diff line change @@ -30,12 +30,6 @@ void RunMicrotasks(const FunctionCallbackInfo<Value>& args) {
30
30
args.GetIsolate ()->RunMicrotasks ();
31
31
}
32
32
33
- void SetupTraceCategoryState (const FunctionCallbackInfo<Value>& args) {
34
- Environment* env = Environment::GetCurrent (args);
35
- CHECK (args[0 ]->IsFunction ());
36
- env->set_trace_category_state_function (args[0 ].As <Function>());
37
- }
38
-
39
33
void SetupNextTick (const FunctionCallbackInfo<Value>& args) {
40
34
Environment* env = Environment::GetCurrent (args);
41
35
Isolate* isolate = env->isolate ();
@@ -136,7 +130,6 @@ void SetupPromises(const FunctionCallbackInfo<Value>& args) {
136
130
// completes so that it can be gc'd as soon as possible.
137
131
void SetupBootstrapObject(Environment* env,
138
132
Local<Object> bootstrapper) {
139
- BOOTSTRAP_METHOD (_setupTraceCategoryState, SetupTraceCategoryState);
140
133
BOOTSTRAP_METHOD (_setupNextTick, SetupNextTick);
141
134
BOOTSTRAP_METHOD (_setupPromises, SetupPromises);
142
135
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ namespace node {
11
11
12
12
using v8::Array;
13
13
using v8::Context;
14
+ using v8::Function;
14
15
using v8::FunctionCallbackInfo;
15
16
using v8::FunctionTemplate;
16
17
using v8::Local;
@@ -102,13 +103,23 @@ void GetEnabledCategories(const FunctionCallbackInfo<Value>& args) {
102
103
}
103
104
}
104
105
106
+ static void SetTraceCategoryStateUpdateHandler (
107
+ const FunctionCallbackInfo<Value>& args) {
108
+ Environment* env = Environment::GetCurrent (args);
109
+ CHECK (args[0 ]->IsFunction ());
110
+ env->set_trace_category_state_function (args[0 ].As <Function>());
111
+ }
112
+
105
113
void NodeCategorySet::Initialize (Local<Object> target,
106
114
Local<Value> unused,
107
115
Local<Context> context,
108
116
void * priv) {
109
117
Environment* env = Environment::GetCurrent (context);
110
118
111
119
env->SetMethod (target, " getEnabledCategories" , GetEnabledCategories);
120
+ env->SetMethod (
121
+ target, " setTraceCategoryStateUpdateHandler" ,
122
+ SetTraceCategoryStateUpdateHandler);
112
123
113
124
Local<FunctionTemplate> category_set =
114
125
env->NewFunctionTemplate (NodeCategorySet::New);
You can’t perform that action at this time.
0 commit comments