Skip to content

Commit c22082e

Browse files
authored
Merge pull request #40 from yahoo/node12
Added support for node v12
2 parents 38849c3 + 303ac8d commit c22082e

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ addons:
99
- g++-4.9
1010
env: CXX=g++-4.9 CC=gcc-4.9
1111
node_js:
12-
- "4"
13-
- "6"
1412
- "8"
1513
- "10"
14+
- "12"

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"name": "monitr",
33
"description": "Node process monitoring tool",
4-
"version": "1.1.0",
4+
"version": "1.2.0",
55
"author": "Rohini Harendra <rohini.raghav@gmail.com>",
66
"contributors": [
77
{
88
"name": "ET",
99
"email": "evan.torrie@yahoo.com"
10+
},
11+
{
12+
"name": "Sylvio Marcondes",
13+
"email": "sylviom@yahoo.com"
1014
}
1115
],
1216
"os": [

src/monitor.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,15 @@ static void Interrupter(v8::Isolate* isolate, void *data) {
162162

163163
fprintf(stderr, "Interrupted: (frames: %d of %d)\n", std::min(frameCount, kMaxFrames), frameCount);
164164
for (int i = 0; i < stack->GetFrameCount(); ++i ) {
165-
v8::Local<StackFrame> frame = stack->GetFrame( i );
165+
v8::Local<StackFrame> frame = stack->GetFrame(
166+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION >= 7)
167+
isolate,
168+
#endif
169+
i );
166170
int line = frame->GetLineNumber();
167171
int col = frame->GetColumn();
168-
v8::String::Utf8Value fn(frame->GetFunctionName());
169-
v8::String::Utf8Value script(frame->GetScriptName());
172+
Nan::Utf8String fn(frame->GetFunctionName());
173+
Nan::Utf8String script(frame->GetScriptName());
170174

171175
fprintf(stderr, " at %s (%s:%d:%d)\n",
172176
fn.length() == 0 ? "<anonymous>" : *fn, *script, line, col);
@@ -667,7 +671,8 @@ int NodeMonitor::getIntFunction(const char* funcName) {
667671
Nan::HandleScope scope;
668672
Local<Value> res = callFunction(funcName);
669673
if (res->IsNumber()) {
670-
return res->Uint32Value();
674+
uint32_t value = res->Uint32Value(Nan::GetCurrentContext()).FromJust();
675+
return value;
671676
}
672677
return 0;
673678
}
@@ -677,7 +682,8 @@ bool NodeMonitor::getBooleanFunction(const char* funcName) {
677682
Nan::HandleScope scope;
678683
Local<Value> res = callFunction(funcName);
679684
if (res->IsBoolean()) {
680-
return res->BooleanValue();
685+
bool value = res->BooleanValue(Nan::GetCurrentContext()).FromJust();
686+
return value;
681687
}
682688
return false;
683689
}
@@ -949,7 +955,7 @@ static NAN_METHOD(SetterIPCMonitorPath) {
949955
(!info[0]->IsString() && !info[0]->IsUndefined() && !info[0]->IsNull())) {
950956
THROW_BAD_ARGS();
951957
}
952-
String::Utf8Value ipcMonitorPath(info[0]);
958+
Nan::Utf8String ipcMonitorPath(info[0]);
953959
_ipcMonitorPath = *ipcMonitorPath;
954960
}
955961

0 commit comments

Comments
 (0)