Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved Node V12 build error #5

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"iosfwd": "cpp"
}
}
10 changes: 5 additions & 5 deletions src/heapdiff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ heapdiff::HeapDiff::~HeapDiff()
}

void
heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
heapdiff::HeapDiff::Initialize ( v8::Local<v8::Object> target )
{
Nan::HandleScope scope;

Expand All @@ -52,8 +52,8 @@ heapdiff::HeapDiff::Initialize ( v8::Handle<v8::Object> target )
t->SetClassName(Nan::New<v8::String>("HeapDiff").ToLocalChecked());

Nan::SetPrototypeMethod(t, "end", End);

target->Set(Nan::New<v8::String>("HeapDiff").ToLocalChecked(), t->GetFunction());
v8::Local<v8::Context> context = Nan::GetCurrentContext();
target->Set(Nan::New<v8::String>("HeapDiff").ToLocalChecked(), t->GetFunction(context).ToLocalChecked());
}

NAN_METHOD(heapdiff::HeapDiff::New)
Expand Down Expand Up @@ -94,7 +94,7 @@ static string handleToStr(const Local<Value> & str)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();

String::Utf8Value utfString(isolate, str->ToString());
String::Utf8Value utfString(isolate, str);

return *utfString;
}
Expand Down Expand Up @@ -223,7 +223,7 @@ static void manageChange(changeset & changes, const HeapGraphNode * node, bool a
return;
}

static Handle<Value> changesetToObject(changeset & changes)
static Local<Value> changesetToObject(changeset & changes)
{
Nan::EscapableHandleScope scope;
Local<Array> a = Nan::New<v8::Array>();
Expand Down
2 changes: 1 addition & 1 deletion src/heapdiff.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace heapdiff
class HeapDiff : public Nan::ObjectWrap
{
public:
static void Initialize ( v8::Handle<v8::Object> target );
static void Initialize ( v8::Local<v8::Object> target );

static NAN_METHOD(New);
static NAN_METHOD(End);
Expand Down
2 changes: 1 addition & 1 deletion src/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "memwatch.hh"

extern "C" {
void init (v8::Handle<v8::Object> target)
void init (v8::Local<v8::Object> target)
{
v8::Isolate * isolate = target->GetIsolate();

Expand Down
4 changes: 2 additions & 2 deletions src/memwatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using namespace v8;
using namespace node;

Handle<Object> g_context;
Local<Object> g_context;
Nan::Callback *g_cb;

struct Baton {
Expand Down Expand Up @@ -250,7 +250,7 @@ NAN_METHOD(memwatch::trigger_gc) {
Nan::HandleScope scope;
int deadline_in_ms = 500;
if (info.Length() >= 1 && info[0]->IsNumber()) {
deadline_in_ms = (int)(info[0]->Int32Value());
deadline_in_ms = (int)(Nan::To<int32_t>(info[0]).FromJust());
}
#if (NODE_MODULE_VERSION >= 0x002D)
Nan::IdleNotification(deadline_in_ms);
Expand Down