diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ce48fa6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "iosfwd": "cpp" + } +} \ No newline at end of file diff --git a/src/heapdiff.cc b/src/heapdiff.cc index cd407c3..78faba4 100644 --- a/src/heapdiff.cc +++ b/src/heapdiff.cc @@ -43,7 +43,7 @@ heapdiff::HeapDiff::~HeapDiff() } void -heapdiff::HeapDiff::Initialize ( v8::Handle target ) +heapdiff::HeapDiff::Initialize ( v8::Local target ) { Nan::HandleScope scope; @@ -52,8 +52,8 @@ heapdiff::HeapDiff::Initialize ( v8::Handle target ) t->SetClassName(Nan::New("HeapDiff").ToLocalChecked()); Nan::SetPrototypeMethod(t, "end", End); - - target->Set(Nan::New("HeapDiff").ToLocalChecked(), t->GetFunction()); + v8::Local context = Nan::GetCurrentContext(); + target->Set(Nan::New("HeapDiff").ToLocalChecked(), t->GetFunction(context).ToLocalChecked()); } NAN_METHOD(heapdiff::HeapDiff::New) @@ -94,7 +94,7 @@ static string handleToStr(const Local & str) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); - String::Utf8Value utfString(isolate, str->ToString()); + String::Utf8Value utfString(isolate, str); return *utfString; } @@ -223,7 +223,7 @@ static void manageChange(changeset & changes, const HeapGraphNode * node, bool a return; } -static Handle changesetToObject(changeset & changes) +static Local changesetToObject(changeset & changes) { Nan::EscapableHandleScope scope; Local a = Nan::New(); diff --git a/src/heapdiff.hh b/src/heapdiff.hh index 917d7a6..2433264 100644 --- a/src/heapdiff.hh +++ b/src/heapdiff.hh @@ -15,7 +15,7 @@ namespace heapdiff class HeapDiff : public Nan::ObjectWrap { public: - static void Initialize ( v8::Handle target ); + static void Initialize ( v8::Local target ); static NAN_METHOD(New); static NAN_METHOD(End); diff --git a/src/init.cc b/src/init.cc index 47e17d2..5ea54b6 100644 --- a/src/init.cc +++ b/src/init.cc @@ -9,7 +9,7 @@ #include "memwatch.hh" extern "C" { - void init (v8::Handle target) + void init (v8::Local target) { v8::Isolate * isolate = target->GetIsolate(); diff --git a/src/memwatch.cc b/src/memwatch.cc index fcf1a81..d5fbd68 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -20,7 +20,7 @@ using namespace v8; using namespace node; -Handle g_context; +Local g_context; Nan::Callback *g_cb; struct Baton { @@ -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(info[0]).FromJust()); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms);