@@ -108,15 +108,6 @@ void OnUserSignal(const FunctionCallbackInfo<Value>& info) {
108
108
isolate, env, *value, __func__, filename, info[0 ].As <String>());
109
109
}
110
110
111
- // Native module initializer function, called when the module is require'd
112
- void InitializeReport (Isolate* isolate, Environment* env) {
113
- // Register the boot time of the process, for
114
- // computing resource consumption average etc.
115
- std::shared_ptr<PerIsolateOptions> options = env->isolate_data ()->options ();
116
-
117
- if (options->report_signal == " " ) options->report_signal = " SIGUSR2" ;
118
- }
119
-
120
111
// A method to sync up data elements in the JS land with its
121
112
// corresponding elements in the C++ world. Required because
122
113
// (i) the tunables are first intercepted through the CLI but
@@ -236,8 +227,9 @@ void SyncConfig(const FunctionCallbackInfo<Value>& info) {
236
227
Local<Value> signal_value;
237
228
Local<Value> file_value;
238
229
Local<Value> path_value;
239
- if (!node::ToV8Value (context, options->report_signal )
240
- .ToLocal (&signal_value))
230
+ std::string signal = options->report_signal ;
231
+ if (signal .empty ()) signal = " SIGUSR2" ;
232
+ if (!node::ToV8Value (context, signal ).ToLocal (&signal_value))
241
233
return ;
242
234
if (!obj->Set (context, signalkey, signal_value).FromJust ()) return ;
243
235
@@ -264,8 +256,6 @@ static void Initialize(Local<Object> exports,
264
256
Local<Context> context) {
265
257
Environment* env = Environment::GetCurrent (context);
266
258
std::shared_ptr<PerIsolateOptions> options = env->isolate_data ()->options ();
267
- Isolate* isolate = env->isolate ();
268
- InitializeReport (isolate, env);
269
259
env->SetMethod (exports, " triggerReport" , TriggerReport);
270
260
env->SetMethod (exports, " getReport" , GetReport);
271
261
env->SetMethod (exports, " onUnCaughtException" , OnUncaughtException);
0 commit comments