From cc5180edb4693f28259e21aee815b6f60b43b30d Mon Sep 17 00:00:00 2001 From: Dan Kang Date: Wed, 22 Jun 2016 11:37:13 +0900 Subject: [PATCH 1/2] chore & test: update library & use node-gyp for test * update nan version (2.1.0 => 2.3.5) * use node-gyp instead of pangyp(deprecated) * tested on nodejs 4.4.5 & 6.2.2 --- Makefile | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1df4764..59df89e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ iojs: nodejs: @NODE_ENV=development bash ./cli/nodejs.sh rebuild: iojs install - @NODE_ENV=development ./node_modules/.bin/pangyp rebuild --verbose + @NODE_ENV=development ./node_modules/.bin/node-gyp rebuild --verbose bootstrap: install @NODE_ENV=development sh ./cli/bootstrap.sh mem_test: install rebuild bootstrap diff --git a/package.json b/package.json index b2a0bc9..be87e03 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "bindings": "~1.2.1", "debug": "~2.2.0", "is-object": "~1.0.1", - "nan": "~2.1.0", - "pangyp": "~2.3.0" + "nan": "~2.3.5", + "node-gyp": "~3.3.1" }, "devDependencies": { "chai": "~3.2.0", From 9acc89253dee534138624c47b03fe1f5fd821c2b Mon Sep 17 00:00:00 2001 From: Shankar Karuppiah Date: Sat, 16 Jul 2016 23:55:49 +0300 Subject: [PATCH 2/2] Fix node 6 deprecation warnings --- src/city.cc | 3 +-- src/city6.cc | 3 +-- src/country.cc | 3 +-- src/country6.cc | 3 +-- src/netspeed.cc | 3 +-- src/netspeedcell.cc | 3 +-- src/org.cc | 3 +-- src/region.cc | 3 +-- 8 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/city.cc b/src/city.cc index 06baf5b..8e71645 100644 --- a/src/city.cc +++ b/src/city.cc @@ -25,8 +25,7 @@ void City::Init(v8::Local exports) { tpl->SetClassName(Nan::New("City").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("City").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/city6.cc b/src/city6.cc index 07d6069..351c2a0 100644 --- a/src/city6.cc +++ b/src/city6.cc @@ -27,8 +27,7 @@ void City6::Init(v8::Local exports) { tpl->SetClassName(Nan::New("City6").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("City6").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/country.cc b/src/country.cc index 81063c3..61e29e4 100644 --- a/src/country.cc +++ b/src/country.cc @@ -26,8 +26,7 @@ void Country::Init(v8::Local exports) { tpl->SetClassName(Nan::New("Country").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("Country").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/country6.cc b/src/country6.cc index 33bc07e..03ff351 100644 --- a/src/country6.cc +++ b/src/country6.cc @@ -26,8 +26,7 @@ void Country6::Init(v8::Local exports) { tpl->SetClassName(Nan::New("Country6").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("Country6").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/netspeed.cc b/src/netspeed.cc index 015b2c9..8988dc0 100644 --- a/src/netspeed.cc +++ b/src/netspeed.cc @@ -26,8 +26,7 @@ void NetSpeed::Init(v8::Local exports) { tpl->SetClassName(Nan::New("NetSpeed").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("NetSpeed").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/netspeedcell.cc b/src/netspeedcell.cc index bd9c818..9a39cc0 100644 --- a/src/netspeedcell.cc +++ b/src/netspeedcell.cc @@ -26,8 +26,7 @@ void NetSpeedCell::Init(v8::Local exports) { tpl->SetClassName(Nan::New("NetSpeedCell").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("NetSpeedCell").ToLocalChecked(), tpl->GetFunction()); diff --git a/src/org.cc b/src/org.cc index f2be74f..b90ad9f 100644 --- a/src/org.cc +++ b/src/org.cc @@ -25,8 +25,7 @@ void Org::Init(v8::Local exports) { tpl->SetClassName(Nan::New("Org").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("Org").ToLocalChecked(), tpl->GetFunction());;; diff --git a/src/region.cc b/src/region.cc index 92bf900..bba18d4 100644 --- a/src/region.cc +++ b/src/region.cc @@ -27,8 +27,7 @@ void Region::Init(v8::Local exports) { tpl->SetClassName(Nan::New("Region").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("lookupSync").ToLocalChecked(), - Nan::New(lookupSync)->GetFunction()); + Nan::SetPrototypeMethod(tpl, "lookupSync", lookupSync); constructor.Reset(tpl->GetFunction()); exports->Set(Nan::New("Region").ToLocalChecked(), tpl->GetFunction());