@@ -108,15 +108,6 @@ void OnUserSignal(const FunctionCallbackInfo<Value>& info) {
108108 isolate, env, *value, __func__, filename, info[0].As<String>());
109109}
110110
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-
120111// A method to sync up data elements in the JS land with its
121112// corresponding elements in the C++ world. Required because
122113// (i) the tunables are first intercepted through the CLI but
@@ -236,8 +227,9 @@ void SyncConfig(const FunctionCallbackInfo<Value>& info) {
236227 Local<Value> signal_value;
237228 Local<Value> file_value;
238229 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))
241233 return;
242234 if (!obj->Set(context, signalkey, signal_value).FromJust()) return;
243235
@@ -264,8 +256,6 @@ static void Initialize(Local<Object> exports,
264256 Local<Context> context) {
265257 Environment* env = Environment::GetCurrent(context);
266258 std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();
267- Isolate* isolate = env->isolate();
268- InitializeReport(isolate, env);
269259 env->SetMethod(exports, "triggerReport", TriggerReport);
270260 env->SetMethod(exports, "getReport", GetReport);
271261 env->SetMethod(exports, "onUnCaughtException", OnUncaughtException);
0 commit comments