From 78df9002840fbf534d77f6b2dd87575985d99f1a Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 19 Feb 2015 12:36:51 -0500 Subject: [PATCH 1/8] break out NODE_EXE env var --- .travis.yml | 18 ++++++++++++++---- scripts/install_node.sh | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7edbcad90..e8babddf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,25 +7,35 @@ matrix: include: - os: linux compiler: clang - env: FLAVOR=linux CXX=clang++-3.5 BUILDTYPE=Release + env: + - FLAVOR: linux + - CXX: clang++-3.5 + - NODE_EXE: "node" + - NODE_VERSION: 0.10.36 addons: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: linux compiler: gcc - env: FLAVOR=linux CXX=g++-4.9 BUILDTYPE=Release + env: + - FLAVOR: linux + - CXX: g++-4.9 + - NODE_EXE: "node" + - NODE_VERSION: 0.10.36 addons: apt: sources: [ 'ubuntu-toolchain-r-test' ] packages: [ 'gdb', 'g++-4.9', 'gcc-4.9', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: osx compiler: clang - env: FLAVOR=osx BUILDTYPE=Release + env: + - FLAVOR: osx + - NODE_EXE: "node" + - NODE_VERSION: 0.10.36 env: global: - - NODE_VERSION: 0.10.36 - LD_LIBRARY_PATH: "/usr/local/lib" - secure: pz/HAMQpnde//JJi3f+RcW32APN6g3QyFAH41JlZwgsM5Daj9RRoXqUcNg4hEyTvlThtc5t+wQQ2ejYAjMwDu00GAzRFJ03Sm45w2fPvith9fu4crXsyPUvWUfWPC0ajTXzorN4cwFwOoMoeo9DihLwb0EC0n4T6jWdBCae3k+s= - secure: jYFAOQoMZkZVyc5AFPBKhR9oDqp5CciwCxFhVEHVjdImM+8V60loKazyw+bVLIjzKLnQbKKdiDudWL9TE1ylK/XSlF3K7o4gU2vIh5WzosKnU70Sanxd6tHt/Ui5eK+bAymKHbLdGiXIZtBZE0tML6+wgJ9vhV4ZKna5dM9tps4= diff --git a/scripts/install_node.sh b/scripts/install_node.sh index 49f81a4aa..311b00424 100755 --- a/scripts/install_node.sh +++ b/scripts/install_node.sh @@ -4,10 +4,10 @@ set -e set -o pipefail # Mason exists on PATH from sourcing mbgl install script -mapbox_time "node" \ -mason install node $NODE_VERSION +mapbox_time $NODE_EXE \ +mason install $NODE_EXE $NODE_VERSION -export PATH="`mason prefix node $NODE_VERSION`/bin":"$PATH" +export PATH="`mason prefix $NODE_EXE $NODE_VERSION`/bin":"$PATH" -node --version +$NODE_EXE --version npm --version From 1455822111cbdd47f1d0a82a97398d3ef0b59f8e Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 19 Feb 2015 12:43:56 -0500 Subject: [PATCH 2/8] BIG matrix with multiple node versions and iojs --- .travis.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8babddf7..1e2c5527d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,28 @@ sudo: false matrix: include: + - os: linux + compiler: clang + env: + - FLAVOR: linux + - CXX: clang++-3.5 + - NODE_EXE: "iojs" + - NODE_VERSION: 1.2.0 + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] + packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] + - os: linux + compiler: clang + env: + - FLAVOR: linux + - CXX: clang++-3.5 + - NODE_EXE: "node" + - NODE_VERSION: 0.12.0 + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] + packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: linux compiler: clang env: @@ -16,6 +38,28 @@ matrix: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] + - os: linux + compiler: gcc + env: + - FLAVOR: linux + - CXX: g++-4.9 + - NODE_EXE: "iojs" + - NODE_VERSION: 1.2.0 + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test' ] + packages: [ 'gdb', 'g++-4.9', 'gcc-4.9', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] + - os: linux + compiler: gcc + env: + - FLAVOR: linux + - CXX: g++-4.9 + - NODE_EXE: "node" + - NODE_VERSION: 0.12.0 + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test' ] + packages: [ 'gdb', 'g++-4.9', 'gcc-4.9', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: linux compiler: gcc env: @@ -27,6 +71,18 @@ matrix: apt: sources: [ 'ubuntu-toolchain-r-test' ] packages: [ 'gdb', 'g++-4.9', 'gcc-4.9', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] + - os: osx + compiler: clang + env: + - FLAVOR: osx + - NODE_EXE: "iojs" + - NODE_VERSION: 1.2.0 + - os: osx + compiler: clang + env: + - FLAVOR: osx + - NODE_EXE: "node" + - NODE_VERSION: 0.12.0 - os: osx compiler: clang env: From c0fe624ecd4ed6cbfc46da59bd62bb1917cb6df7 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 19 Feb 2015 16:19:31 -0500 Subject: [PATCH 3/8] add node v0.12 and io.js compatibility --- src/compress_png.cpp | 4 ++-- src/node_file_source.cpp | 36 +++++++++++++++++++++++++++-------- src/node_file_source.hpp | 4 ++++ src/node_log.cpp | 9 +++++---- src/node_map.cpp | 8 ++++++-- src/node_mapbox_gl_native.cpp | 3 +-- src/node_request.cpp | 30 +++++++++++++++-------------- src/node_request.hpp | 2 +- 8 files changed, 63 insertions(+), 33 deletions(-) diff --git a/src/compress_png.cpp b/src/compress_png.cpp index 068abe65f..99cec5b1b 100644 --- a/src/compress_png.cpp +++ b/src/compress_png.cpp @@ -8,15 +8,15 @@ public: CompressPNGWorker(NanCallback *callback_, v8::Local buffer_, uint32_t width_, uint32_t height_) : NanAsyncWorker(callback_), - buffer(v8::Persistent::New(buffer_)), data(node::Buffer::Data(buffer_)), width(width_), height(height_) { + NanAssignPersistent(buffer, buffer_); assert(width * height * 4 == node::Buffer::Length(buffer_)); } ~CompressPNGWorker() { - buffer.Dispose(); + NanDisposePersistent(buffer); } void Execute() { diff --git a/src/node_file_source.cpp b/src/node_file_source.cpp index e0b78008b..acf96bf12 100644 --- a/src/node_file_source.cpp +++ b/src/node_file_source.cpp @@ -96,11 +96,18 @@ void NodeFileSource::processAdd(mbgl::Request *req) { queue->ref(); } - auto requestHandle = v8::Local::New(NodeRequest::Create(handle_, req)); - pending.emplace(req, std::move(v8::Persistent::New(requestHandle))); + auto handle = NanObjectWrapHandle(this); + auto requestHandle = NanNew(NodeRequest::Create(handle, request)); +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + v8::Persistent requestPersistent; + NanAssignPersistent(requestPersistent, requestHandle); +#else + const v8::UniquePersistent requestPersistent(v8::Isolate::GetCurrent(), requestHandle); +#endif + pending.emplace(request, std::move(requestPersistent)); v8::Local argv[] = { requestHandle }; - NanMakeCallback(handle_, NanNew("request"), 1, argv); + NanMakeCallback(handle, NanNew("request"), 1, argv); } void NodeFileSource::processCancel(mbgl::Request *req) { @@ -111,10 +118,18 @@ void NodeFileSource::processCancel(mbgl::Request *req) { // The response callback was already fired. There is no point in calling the cancelation // callback because the request is already completed. } else { - auto requestHandle = v8::Local::New(it->second); +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + auto requestHandle = NanNew(it->second); +#else + auto requestHandle = v8::Local::New(v8::Isolate::GetCurrent(), it->second); +#endif // Dispose and remove the persistent handle - it->second.Dispose(); +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + NanDisposePersistent(it->second); +#else + // it->second.Reset(); +#endif pending.erase(it); // Make sure the the loop can exit when there are no pending requests. @@ -122,9 +137,10 @@ void NodeFileSource::processCancel(mbgl::Request *req) { queue->unref(); } - if (handle_->Has(NanNew("cancel"))) { + auto handle = NanObjectWrapHandle(this); + if (handle->Has(NanNew("cancel"))) { v8::Local argv[] = { requestHandle }; - NanMakeCallback(handle_, NanNew("cancel"), 1, argv); + NanMakeCallback(handle, NanNew("cancel"), 1, argv); } // Set the request handle in the request wrapper handle to null @@ -139,7 +155,11 @@ void NodeFileSource::notify(mbgl::Request *req, const std::shared_ptrsecond.Dispose(); +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + NanDisposePersistent(it->second); +#else + // it->second.Dispose(); +#endif pending.erase(it); // Make sure the the loop can exit when there are no pending requests. diff --git a/src/node_file_source.hpp b/src/node_file_source.hpp index 791b96969..c0dbe58d2 100644 --- a/src/node_file_source.hpp +++ b/src/node_file_source.hpp @@ -46,7 +46,11 @@ private: void processCancel(mbgl::Request*); private: +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 std::map> pending; +#else + std::map &> pending; +#endif Queue *queue = nullptr; }; diff --git a/src/node_log.cpp b/src/node_log.cpp index f10d52d44..d7cf0e0d8 100644 --- a/src/node_log.cpp +++ b/src/node_log.cpp @@ -32,7 +32,7 @@ NodeLogObserver::NodeLogObserver(v8::Handle target) : queue(new Queue(uv_default_loop(), [this](LogMessage &message) { NanScope(); - auto msg = v8::Object::New(); + auto msg = NanNew(); msg->Set(NanNew("class"), NanNew(mbgl::EventClass(message.event).c_str())); msg->Set(NanNew("severity"), NanNew(mbgl::EventSeverityClass(message.severity).c_str())); if (message.code != -1) { @@ -49,11 +49,12 @@ NodeLogObserver::NodeLogObserver(v8::Handle target) } v8::Local argv[] = { NanNew("message"), msg }; - auto emit = module->Get(NanNew("emit"))->ToObject(); - emit->CallAsFunction(module, 2, argv); + auto handle = NanNew(module); + auto emit = handle->Get(NanNew("emit"))->ToObject(); + emit->CallAsFunction(handle, 2, argv); })) { NanScope(); - module = v8::Persistent::New(target); + NanAssignPersistent(module, target); // Don't keep the event loop alive. queue->unref(); diff --git a/src/node_map.cpp b/src/node_map.cpp index b6aae1302..e5b3fda5f 100644 --- a/src/node_map.cpp +++ b/src/node_map.cpp @@ -239,7 +239,7 @@ void NodeMap::renderFinished() { assert(!image); if (img) { - v8::Local result = v8::Object::New(); + auto result = NanNew(); result->Set(NanNew("width"), NanNew(img->width)); result->Set(NanNew("height"), NanNew(img->height)); @@ -283,7 +283,11 @@ NodeMap::NodeMap(v8::Handle source_) : NanAssignPersistent(source, source_); async->data = this; +#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 uv_async_init(uv_default_loop(), async, [](uv_async_t *as, int) { +#else + uv_async_init(uv_default_loop(), async, [](uv_async_t *as) { +#endif reinterpret_cast(as->data)->renderFinished(); }); @@ -292,7 +296,7 @@ NodeMap::NodeMap(v8::Handle source_) : } NodeMap::~NodeMap() { - source.Dispose(); + NanDisposePersistent(source); uv_close(reinterpret_cast(async), [] (uv_handle_t *handle) { delete reinterpret_cast(handle); diff --git a/src/node_mapbox_gl_native.cpp b/src/node_mapbox_gl_native.cpp index e784681a0..a7a0f0fcf 100644 --- a/src/node_mapbox_gl_native.cpp +++ b/src/node_mapbox_gl_native.cpp @@ -11,7 +11,6 @@ #include "node_request.hpp" #include "compress_png.hpp" - void RegisterModule(v8::Handle exports) { NanScope(); @@ -22,7 +21,7 @@ void RegisterModule(v8::Handle exports) { // Exports Resource constants. auto ConstantProperty = static_cast(v8::ReadOnly | v8::DontDelete); - auto resource = v8::Object::New(); + auto resource = NanNew(); resource->ForceSet(NanNew("Unknown"), NanNew(mbgl::Resource::Unknown), ConstantProperty); resource->ForceSet(NanNew("Tile"), NanNew(mbgl::Resource::Tile), ConstantProperty); resource->ForceSet(NanNew("Glyphs"), NanNew(mbgl::Resource::Glyphs), ConstantProperty); diff --git a/src/node_request.cpp b/src/node_request.cpp index b67fd2097..0fdc05bff 100644 --- a/src/node_request.cpp +++ b/src/node_request.cpp @@ -35,34 +35,35 @@ NAN_METHOD(NodeRequest::New) { return NanThrowTypeError("Cannot create Request objects explicitly"); } - auto source = v8::Persistent::New(args[0]->ToObject()); + v8::Persistent source; + NanAssignPersistent(source, args[0]->ToObject()); + auto request = reinterpret_cast(args[1].As()->Value()); - auto req = new NodeRequest(source, request); + auto req = new NodeRequest(NanNew(std::move(source)), request); req->Wrap(args.This()); NanReturnValue(args.This()); } v8::Handle NodeRequest::Create(v8::Handle source, mbgl::Request *request) { - NanScope(); - v8::Local argv[] = { v8::Local::New(source), NanNew(request) }; - auto instance = constructorTemplate->GetFunction()->NewInstance(2, argv); + NanEscapableScope(); - instance->Set(NanNew("url"), NanNew(request->resource.url), v8::ReadOnly); - instance->Set(NanNew("kind"), NanNew(int(request->resource.kind)), v8::ReadOnly); + v8::Local argv[] = { NanNew(source), NanNew(request) }; + auto instance = NanNew(constructorTemplate)->GetFunction()->NewInstance(2, argv); - NanReturnValue(instance); + instance->ForceSet(NanNew("url"), NanNew(request->resource.url), v8::ReadOnly); + instance->ForceSet(NanNew("kind"), NanNew(int(request->resource.kind)), v8::ReadOnly); + + return NanEscapeScope(instance); } NAN_METHOD(NodeRequest::Respond) { - NanScope(); - auto nodeRequest = ObjectWrap::Unwrap(args.Holder()); if (!nodeRequest->request) { return NanThrowError("Request has already been responded to, or was canceled."); } - auto source = ObjectWrap::Unwrap(nodeRequest->source); + auto source = ObjectWrap::Unwrap(NanNew(nodeRequest->source)); auto request = nodeRequest->request; nodeRequest->request = nullptr; @@ -131,12 +132,13 @@ NAN_METHOD(NodeRequest::Respond) { //////////////////////////////////////////////////////////////////////////////////////////////// // Instance -NodeRequest::NodeRequest(v8::Persistent source_, mbgl::Request *request_) - : source(source_), request(request_) { +NodeRequest::NodeRequest(v8::Local source_, mbgl::Request *request_) + : request(request_) { + NanAssignPersistent(source, source_); } NodeRequest::~NodeRequest() { - source.Dispose(); + NanDisposePersistent(source); } void NodeRequest::cancel() { diff --git a/src/node_request.hpp b/src/node_request.hpp index ebbd962d4..009855066 100644 --- a/src/node_request.hpp +++ b/src/node_request.hpp @@ -27,7 +27,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////// // Instance public: - NodeRequest(v8::Persistent source, mbgl::Request *request); + NodeRequest(v8::Local source, mbgl::Request *request); ~NodeRequest(); void cancel(); From 11b214fed6529a3f05f23883fc797d90ad5ed15a Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 14 May 2015 12:55:12 -0400 Subject: [PATCH 4/8] if/else on NODE_MODULE_VERSION instead of UV_VERSION --- src/node_file_source.cpp | 28 ++++++++++++++-------------- src/node_file_source.hpp | 7 ++++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/node_file_source.cpp b/src/node_file_source.cpp index acf96bf12..298c30c0b 100644 --- a/src/node_file_source.cpp +++ b/src/node_file_source.cpp @@ -97,14 +97,14 @@ void NodeFileSource::processAdd(mbgl::Request *req) { } auto handle = NanObjectWrapHandle(this); - auto requestHandle = NanNew(NodeRequest::Create(handle, request)); -#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 + auto requestHandle = NanNew(NodeRequest::Create(handle, req)); +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + const v8::UniquePersistent requestPersistent(v8::Isolate::GetCurrent(), requestHandle); +#else v8::Persistent requestPersistent; NanAssignPersistent(requestPersistent, requestHandle); -#else - const v8::UniquePersistent requestPersistent(v8::Isolate::GetCurrent(), requestHandle); #endif - pending.emplace(request, std::move(requestPersistent)); + pending.emplace(req, std::move(requestPersistent)); v8::Local argv[] = { requestHandle }; NanMakeCallback(handle, NanNew("request"), 1, argv); @@ -118,17 +118,17 @@ void NodeFileSource::processCancel(mbgl::Request *req) { // The response callback was already fired. There is no point in calling the cancelation // callback because the request is already completed. } else { -#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 - auto requestHandle = NanNew(it->second); -#else +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) auto requestHandle = v8::Local::New(v8::Isolate::GetCurrent(), it->second); +#else + auto requestHandle = NanNew(it->second); #endif // Dispose and remove the persistent handle -#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 - NanDisposePersistent(it->second); -#else +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) // it->second.Reset(); +#else + NanDisposePersistent(it->second); #endif pending.erase(it); @@ -155,10 +155,10 @@ void NodeFileSource::notify(mbgl::Request *req, const std::shared_ptrsecond); -#else +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) // it->second.Dispose(); +#else + NanDisposePersistent(it->second); #endif pending.erase(it); diff --git a/src/node_file_source.hpp b/src/node_file_source.hpp index c0dbe58d2..49ff27e14 100644 --- a/src/node_file_source.hpp +++ b/src/node_file_source.hpp @@ -6,6 +6,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wshadow" #include +#include #include #pragma GCC diagnostic pop @@ -46,10 +47,10 @@ private: void processCancel(mbgl::Request*); private: -#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 - std::map> pending; -#else +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) std::map &> pending; +#else + std::map> pending; #endif Queue *queue = nullptr; }; From b7ab9485d415e5b1c3af1f61da1f01a4e8826d49 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 14 May 2015 13:53:05 -0400 Subject: [PATCH 5/8] upgrade node modules, switch from tap-spec to faucet --- Makefile | 4 ++-- package.json | 17 +++++++++-------- src/node_file_source.cpp | 8 ++------ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index d66f6ad1c..4884d5a5f 100644 --- a/Makefile +++ b/Makefile @@ -63,11 +63,11 @@ $(MBGL)/config/%.gypi: $(MBGL) $(MBGL)/configure .PHONY: test-suite test-suite: - -@(`npm bin`/tape test/render.test.js | `npm bin`/tap-spec) + -@(`npm bin`/tape test/render.test.js | `npm bin`/faucet) .PHONY: test-js test-js: - @(`npm bin`/tape test/js/**/*.test.js | `npm bin`/tap-spec) + @(`npm bin`/tape test/js/**/*.test.js | `npm bin`/faucet) .PHONY: test test: test-js test-suite diff --git a/package.json b/package.json index 65e68b610..e8e2f13fc 100644 --- a/package.json +++ b/package.json @@ -18,20 +18,21 @@ } ], "dependencies": { - "nan": "^1.4.1", - "node-pre-gyp": "^0.6.4" + "nan": "^1.8.4", + "node-pre-gyp": "^0.6.7" }, "bundledDependencies": [ "node-pre-gyp" ], "devDependencies": { - "aws-sdk": "^2.1.9", + "aws-sdk": "^2.1.27", + "faucet": "0.0.1", "mapbox-gl-test-suite": "git://github.com/mapbox/mapbox-gl-test-suite#master", - "mkdirp": "^0.5.0", - "request": "^2.53.0", - "tap-spec": "^2.2.1", - "tape": "^3.5.0", - "st": "^0.5.3" + "mkdirp": "^0.5.1", + "request": "^2.55.0", + "st": "^0.5.3", + "tap-spec": "^3.0.0", + "tape": "^4.0.0" }, "scripts": { "install": "node-pre-gyp install || make", diff --git a/src/node_file_source.cpp b/src/node_file_source.cpp index 298c30c0b..866e6d478 100644 --- a/src/node_file_source.cpp +++ b/src/node_file_source.cpp @@ -125,9 +125,7 @@ void NodeFileSource::processCancel(mbgl::Request *req) { #endif // Dispose and remove the persistent handle -#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) - // it->second.Reset(); -#else +#if (NODE_MODULE_VERSION <= NODE_0_10_MODULE_VERSION) NanDisposePersistent(it->second); #endif pending.erase(it); @@ -155,9 +153,7 @@ void NodeFileSource::notify(mbgl::Request *req, const std::shared_ptr NODE_0_10_MODULE_VERSION) - // it->second.Dispose(); -#else +#if (NODE_MODULE_VERSION <= NODE_0_10_MODULE_VERSION) NanDisposePersistent(it->second); #endif pending.erase(it); From 068491711b936ff267a4e34713a12e10722b7606 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 14 May 2015 13:56:47 -0400 Subject: [PATCH 6/8] test against io.js 2.0.1 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1e2c5527d..0495d8b30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: - FLAVOR: linux - CXX: clang++-3.5 - NODE_EXE: "iojs" - - NODE_VERSION: 1.2.0 + - NODE_VERSION: 2.0.1 addons: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] @@ -44,7 +44,7 @@ matrix: - FLAVOR: linux - CXX: g++-4.9 - NODE_EXE: "iojs" - - NODE_VERSION: 1.2.0 + - NODE_VERSION: 2.0.1 addons: apt: sources: [ 'ubuntu-toolchain-r-test' ] @@ -76,7 +76,7 @@ matrix: env: - FLAVOR: osx - NODE_EXE: "iojs" - - NODE_VERSION: 1.2.0 + - NODE_VERSION: 2.0.1 - os: osx compiler: clang env: From 99e24102c57b0c8515789e503cc118710f936859 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 14 May 2015 13:57:44 -0400 Subject: [PATCH 7/8] drop FLAVOR env var --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0495d8b30..8a7f5c345 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ matrix: - os: linux compiler: clang env: - - FLAVOR: linux - CXX: clang++-3.5 - NODE_EXE: "iojs" - NODE_VERSION: 2.0.1 @@ -19,7 +18,6 @@ matrix: - os: linux compiler: clang env: - - FLAVOR: linux - CXX: clang++-3.5 - NODE_EXE: "node" - NODE_VERSION: 0.12.0 @@ -30,7 +28,6 @@ matrix: - os: linux compiler: clang env: - - FLAVOR: linux - CXX: clang++-3.5 - NODE_EXE: "node" - NODE_VERSION: 0.10.36 @@ -41,7 +38,6 @@ matrix: - os: linux compiler: gcc env: - - FLAVOR: linux - CXX: g++-4.9 - NODE_EXE: "iojs" - NODE_VERSION: 2.0.1 @@ -52,7 +48,6 @@ matrix: - os: linux compiler: gcc env: - - FLAVOR: linux - CXX: g++-4.9 - NODE_EXE: "node" - NODE_VERSION: 0.12.0 @@ -63,7 +58,6 @@ matrix: - os: linux compiler: gcc env: - - FLAVOR: linux - CXX: g++-4.9 - NODE_EXE: "node" - NODE_VERSION: 0.10.36 @@ -74,19 +68,16 @@ matrix: - os: osx compiler: clang env: - - FLAVOR: osx - NODE_EXE: "iojs" - NODE_VERSION: 2.0.1 - os: osx compiler: clang env: - - FLAVOR: osx - NODE_EXE: "node" - NODE_VERSION: 0.12.0 - os: osx compiler: clang env: - - FLAVOR: osx - NODE_EXE: "node" - NODE_VERSION: 0.10.36 From 2da70779c60ba412a3387f1ba5c9147e68c7d89b Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 14 May 2015 14:46:06 -0400 Subject: [PATCH 8/8] gcc -Wshadow is annoying --- binding.gyp | 1 - 1 file changed, 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 1f0f81c1f..9c7cade1d 100644 --- a/binding.gyp +++ b/binding.gyp @@ -52,7 +52,6 @@ '-Werror', '-Wall', '-Wextra', - '-Wshadow', '-Wno-variadic-macros', '-Wno-error=unused-parameter', '-frtti',