Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Commit 6327657

Browse files
committed
Restore uppercase C++ method names
fabac78 changed the exported C++ method names to start with a lower case character to match the name exported to JavaScript land. This turns out to be unnecessary if `Nan::SetMethod()` is used instead of `NAN_EXPORT()`. Restore the original casing of the C++ methods to be consistent with the non-exported C++ methods. PR-URL: #127 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent 4952a46 commit 6327657

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/module.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern std::string commandline_string;
4747
* External JavaScript API for triggering a report
4848
*
4949
******************************************************************************/
50-
NAN_METHOD(triggerReport) {
50+
NAN_METHOD(TriggerReport) {
5151
Nan::HandleScope scope;
5252
v8::Isolate* isolate = info.GetIsolate();
5353
char filename[NR_MAXNAME + 1] = "";
@@ -81,7 +81,7 @@ NAN_METHOD(triggerReport) {
8181
* External JavaScript API for returning a report
8282
*
8383
******************************************************************************/
84-
NAN_METHOD(getReport) {
84+
NAN_METHOD(GetReport) {
8585
Nan::HandleScope scope;
8686
v8::Isolate* isolate = info.GetIsolate();
8787
std::ostringstream out;
@@ -100,7 +100,7 @@ NAN_METHOD(getReport) {
100100
* External JavaScript APIs for node-report configuration
101101
*
102102
******************************************************************************/
103-
NAN_METHOD(setEvents) {
103+
NAN_METHOD(SetEvents) {
104104
Nan::Utf8String parameter(info[0]);
105105
v8::Isolate* isolate = info.GetIsolate();
106106
unsigned int previous_events = nodereport_events; // save previous settings
@@ -132,7 +132,7 @@ NAN_METHOD(setEvents) {
132132
}
133133
#endif
134134
}
135-
NAN_METHOD(setSignal) {
135+
NAN_METHOD(SetSignal) {
136136
#ifndef _WIN32
137137
Nan::Utf8String parameter(info[0]);
138138
unsigned int previous_signal = nodereport_signal; // save previous setting
@@ -145,15 +145,15 @@ NAN_METHOD(setSignal) {
145145
}
146146
#endif
147147
}
148-
NAN_METHOD(setFileName) {
148+
NAN_METHOD(SetFileName) {
149149
Nan::Utf8String parameter(info[0]);
150150
ProcessNodeReportFileName(*parameter);
151151
}
152-
NAN_METHOD(setDirectory) {
152+
NAN_METHOD(SetDirectory) {
153153
Nan::Utf8String parameter(info[0]);
154154
ProcessNodeReportDirectory(*parameter);
155155
}
156-
NAN_METHOD(setVerbose) {
156+
NAN_METHOD(SetVerbose) {
157157
Nan::Utf8String parameter(info[0]);
158158
nodereport_verbose = ProcessNodeReportVerboseSwitch(*parameter);
159159
}
@@ -426,13 +426,13 @@ NAN_MODULE_INIT(Initialize) {
426426
}
427427
#endif
428428

429-
NAN_EXPORT(target, triggerReport);
430-
NAN_EXPORT(target, getReport);
431-
NAN_EXPORT(target, setEvents);
432-
NAN_EXPORT(target, setSignal);
433-
NAN_EXPORT(target, setFileName);
434-
NAN_EXPORT(target, setDirectory);
435-
NAN_EXPORT(target, setVerbose);
429+
Nan::SetMethod(target, "triggerReport", TriggerReport);
430+
Nan::SetMethod(target, "getReport", GetReport);
431+
Nan::SetMethod(target, "setEvents", SetEvents);
432+
Nan::SetMethod(target, "setSignal", SetSignal);
433+
Nan::SetMethod(target, "setFileName", SetFileName);
434+
Nan::SetMethod(target, "setDirectory", SetDirectory);
435+
Nan::SetMethod(target, "setVerbose", SetVerbose);
436436

437437
if (nodereport_verbose) {
438438
#ifdef _WIN32

0 commit comments

Comments
 (0)