Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0579f42

Browse filesBrowse files
cjihrigBridgeAR
authored andcommitted
report: use triggerReport() to handle signals
This commit uses the triggerReport() binding to handle signals and removes the custom onUserSignal() function. PR-URL: #26386 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent b216f44 commit 0579f42
Copy full SHA for 0579f42

File tree

Expand file treeCollapse file tree

3 files changed

+2
-15
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+2
-15
lines changed
Open diff view settings
Collapse file

‎lib/internal/process/report.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/report.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const report = {
104104
function handleSignal(signo) {
105105
if (typeof signo !== 'string')
106106
signo = config.signal;
107-
nr.onUserSignal(signo);
107+
nr.triggerReport(signo, 'Signal', null, '');
108108
}
109109

110110
module.exports = {
Collapse file

‎src/node_report.cc‎

Copy file name to clipboardExpand all lines: src/node_report.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static void PrintJavaScriptStack(JSONWriter* writer,
377377

378378
std::string ss;
379379
if ((!strcmp(location, "OnFatalError")) ||
380-
(!strcmp(location, "OnUserSignal"))) {
380+
(!strcmp(location, "Signal"))) {
381381
ss = "No stack.\nUnavailable.\n";
382382
} else {
383383
String::Utf8Value sv(isolate, stackstr);
Collapse file

‎src/node_report_module.cc‎

Copy file name to clipboardExpand all lines: src/node_report_module.cc
-13Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ void GetReport(const FunctionCallbackInfo<Value>& info) {
7575
.ToLocalChecked());
7676
}
7777

78-
// Signal handler for report action, called from JS land (util.js)
79-
void OnUserSignal(const FunctionCallbackInfo<Value>& info) {
80-
Environment* env = Environment::GetCurrent(info);
81-
Isolate* isolate = env->isolate();
82-
CHECK(info[0]->IsString());
83-
Local<String> str = info[0].As<String>();
84-
String::Utf8Value value(isolate, str);
85-
std::string filename;
86-
TriggerNodeReport(
87-
isolate, env, *value, __func__, filename, info[0].As<String>());
88-
}
89-
9078
// A method to sync up data elements in the JS land with its
9179
// corresponding elements in the C++ world. Required because
9280
// (i) the tunables are first intercepted through the CLI but
@@ -219,7 +207,6 @@ static void Initialize(Local<Object> exports,
219207
std::shared_ptr<PerIsolateOptions> options = env->isolate_data()->options();
220208
env->SetMethod(exports, "triggerReport", TriggerReport);
221209
env->SetMethod(exports, "getReport", GetReport);
222-
env->SetMethod(exports, "onUserSignal", OnUserSignal);
223210
env->SetMethod(exports, "syncConfig", SyncConfig);
224211
}
225212

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.