Skip to content

Commit a6a930c

Browse files
committed
* Fix code to work in Nodejs 7 using conditional statements
1 parent ba80299 commit a6a930c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/node_oom_heapdump_native.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ void ParseArgumentsAndSetErrorHandler(const FunctionCallbackInfo<Value>& args) {
7373
// parse JS arguments
7474
// 1: filename
7575
// 2: addTimestamp boolean
76+
#if NODE_VERSION_AT_LEAST(9, 0, 0)
7677
String::Utf8Value fArg(isolate, args[0]->ToString());
78+
#else
79+
String::Utf8Value fArg(args[0]->ToString());
80+
#endif
7781
strncpy(filename, (const char*)(*fArg), sizeof(filename) - 1);
82+
7883
addTimestamp = args[1]->BooleanValue();
7984
}
8085

0 commit comments

Comments
 (0)