From 5e135861e9cd09cfedc1617fa6057777967e3cc6 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:31:32 +0530 Subject: [PATCH 01/13] resolved --- src/heapdiff.cc | 4 ++-- src/heapdiff.hh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/heapdiff.cc b/src/heapdiff.cc index cd407c3..2b70062 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; @@ -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); From dc6eaa4e5568681e7c8858a16ae245083a976dc4 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:36:44 +0530 Subject: [PATCH 02/13] minor change --- src/heapdiff.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/heapdiff.cc b/src/heapdiff.cc index 2b70062..a905690 100644 --- a/src/heapdiff.cc +++ b/src/heapdiff.cc @@ -52,8 +52,8 @@ heapdiff::HeapDiff::Initialize ( v8::Local 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; } From f5952db79a50c9945fa72f326aa595a15ae3983a Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:37:49 +0530 Subject: [PATCH 03/13] minor change --- .vscode/settings.json | 5 +++++ src/heapdiff.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json 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 a905690..309ee18 100644 --- a/src/heapdiff.cc +++ b/src/heapdiff.cc @@ -52,7 +52,7 @@ heapdiff::HeapDiff::Initialize ( v8::Local target ) t->SetClassName(Nan::New("HeapDiff").ToLocalChecked()); Nan::SetPrototypeMethod(t, "end", End); - v8::Local context = Nan::GetCurrentContext() + v8::Local context = Nan::GetCurrentContext(); target->Set(Nan::New("HeapDiff").ToLocalChecked(), t->GetFunction(context).ToLocalChecked()); } From aef35f6059ae99015b4e421cf5fe1d15f35d9db6 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:39:49 +0530 Subject: [PATCH 04/13] minor change --- src/heapdiff.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/heapdiff.cc b/src/heapdiff.cc index 309ee18..78faba4 100644 --- a/src/heapdiff.cc +++ b/src/heapdiff.cc @@ -52,7 +52,7 @@ heapdiff::HeapDiff::Initialize ( v8::Local target ) t->SetClassName(Nan::New("HeapDiff").ToLocalChecked()); Nan::SetPrototypeMethod(t, "end", End); - v8::Local context = Nan::GetCurrentContext(); + v8::Local context = Nan::GetCurrentContext(); target->Set(Nan::New("HeapDiff").ToLocalChecked(), t->GetFunction(context).ToLocalChecked()); } From 3314d360f8d4fc709e0744e8f0f1cdcf0c6dd507 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:41:29 +0530 Subject: [PATCH 05/13] minor change --- src/init.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From db6f1eb9d16484d495f361661f075a8044ad0a11 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:45:03 +0530 Subject: [PATCH 06/13] minor change --- src/memwatch.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index fcf1a81..eb72059 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,8 @@ 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()); + v8::Local context = Nan::GetCurrentContext(); + deadline_in_ms = (int)(info[0]->Int32Value(context)); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From cb7518fe597be17201511633471d0e27994b3836 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:47:03 +0530 Subject: [PATCH 07/13] minor change --- src/memwatch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index eb72059..e894d5a 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -251,7 +251,7 @@ NAN_METHOD(memwatch::trigger_gc) { int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { v8::Local context = Nan::GetCurrentContext(); - deadline_in_ms = (int)(info[0]->Int32Value(context)); + deadline_in_ms = (int)(info[0]->Int32Value(v8::Isolate::GetCurrent())); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From aa9d5414894fcfe283610713aeb272e9ed4b9763 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:56:46 +0530 Subject: [PATCH 08/13] minor change --- src/memwatch.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index e894d5a..bb0f6bc 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -250,8 +250,7 @@ NAN_METHOD(memwatch::trigger_gc) { Nan::HandleScope scope; int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { - v8::Local context = Nan::GetCurrentContext(); - deadline_in_ms = (int)(info[0]->Int32Value(v8::Isolate::GetCurrent())); + deadline_in_ms = Nan::Maybe Nan::To(v8::Local info[0]); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From 78d2ff11948365175a6bc8ebc3227d422ec17b84 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 00:59:56 +0530 Subject: [PATCH 09/13] minor change --- src/memwatch.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index bb0f6bc..bba48f6 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -250,7 +250,10 @@ NAN_METHOD(memwatch::trigger_gc) { Nan::HandleScope scope; int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { - deadline_in_ms = Nan::Maybe Nan::To(v8::Local info[0]); + v8::Local context = Nan::GetCurrentContext(); + deadline_in_ms = (int)(info[0]->Int32Value()); + + deadline_in_ms = Nan::Maybe Int32Value(v8::Local info[0]); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From ee76b76dde1f0678be5a02ae06b9ccc7f60df6f1 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 01:01:18 +0530 Subject: [PATCH 10/13] minor change --- src/memwatch.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index bba48f6..767effd 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -251,9 +251,9 @@ NAN_METHOD(memwatch::trigger_gc) { int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { v8::Local context = Nan::GetCurrentContext(); - deadline_in_ms = (int)(info[0]->Int32Value()); + // deadline_in_ms = (int)(info[0]->Int32Value()); - deadline_in_ms = Nan::Maybe Int32Value(v8::Local info[0]); + deadline_in_ms = (Nan::Maybe)Int32Value(v8::Local info[0]); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From 94a507a0700303052b024a31f8e170ccae5a96b2 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 01:02:33 +0530 Subject: [PATCH 11/13] minor change --- src/memwatch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index 767effd..e1d5a0e 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -253,7 +253,7 @@ NAN_METHOD(memwatch::trigger_gc) { v8::Local context = Nan::GetCurrentContext(); // deadline_in_ms = (int)(info[0]->Int32Value()); - deadline_in_ms = (Nan::Maybe)Int32Value(v8::Local info[0]); + deadline_in_ms = (int)Int32Value(info[0]); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From c68002cecf8ef5a0b8d4b6e76ff186dd5498d191 Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 01:06:36 +0530 Subject: [PATCH 12/13] minor change --- src/memwatch.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index e1d5a0e..5529573 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -250,10 +250,9 @@ NAN_METHOD(memwatch::trigger_gc) { Nan::HandleScope scope; int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { - v8::Local context = Nan::GetCurrentContext(); + // v8::Local context = Nan::GetCurrentContext(); // deadline_in_ms = (int)(info[0]->Int32Value()); - - deadline_in_ms = (int)Int32Value(info[0]); + deadline_in_ms = (int)(Nan::To(info[0]).FromJust()); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms); From 9511a70975bb44039713fe4768d5c8bab5a13ecd Mon Sep 17 00:00:00 2001 From: venkat Bavandla Date: Tue, 14 Jan 2020 01:07:28 +0530 Subject: [PATCH 13/13] minor change --- src/memwatch.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/memwatch.cc b/src/memwatch.cc index 5529573..d5fbd68 100644 --- a/src/memwatch.cc +++ b/src/memwatch.cc @@ -250,9 +250,7 @@ NAN_METHOD(memwatch::trigger_gc) { Nan::HandleScope scope; int deadline_in_ms = 500; if (info.Length() >= 1 && info[0]->IsNumber()) { - // v8::Local context = Nan::GetCurrentContext(); - // deadline_in_ms = (int)(info[0]->Int32Value()); - deadline_in_ms = (int)(Nan::To(info[0]).FromJust()); + deadline_in_ms = (int)(Nan::To(info[0]).FromJust()); } #if (NODE_MODULE_VERSION >= 0x002D) Nan::IdleNotification(deadline_in_ms);