From 3d48147f2f8d2ef3ed3a9b8848ba0304d27c3403 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 8 Sep 2015 15:17:49 -0400 Subject: [PATCH] add io.js v3.x support --- .travis.yml | 4 ++-- platform/node/CHANGELOG.md | 1 + platform/node/src/node_file_source.cpp | 2 +- platform/node/src/node_mapbox_gl_native.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e300c568af..d16643364fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ matrix: apt: packages: [ 'lib32stdc++6' ] - os: linux - env: FLAVOR=node CXX=clang++-3.5 BUILDTYPE=Release NODE_VERSION=iojs-v2 + env: FLAVOR=node CXX=clang++-3.5 BUILDTYPE=Release NODE_VERSION=iojs-v3 addons: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] @@ -79,7 +79,7 @@ matrix: - os: osx osx_image: xcode6.4 compiler: clang - env: FLAVOR=node NODE_VERSION=iojs-v2 + env: FLAVOR=node NODE_VERSION=iojs-v3 - os: osx osx_image: xcode6.4 compiler: clang diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md index 6d6486bd29d..927cc5ece49 100644 --- a/platform/node/CHANGELOG.md +++ b/platform/node/CHANGELOG.md @@ -9,6 +9,7 @@ render options. - Adds support for rendering v8 styles. - No longer load resources before a render request is made. +- Adds io.js v3.x support. # 1.1.3 diff --git a/platform/node/src/node_file_source.cpp b/platform/node/src/node_file_source.cpp index 29a4748c532..622584846cf 100644 --- a/platform/node/src/node_file_source.cpp +++ b/platform/node/src/node_file_source.cpp @@ -75,7 +75,7 @@ void NodeFileSource::processAdd(const mbgl::Resource& resource) { queue->ref(); } - auto requestHandle = Nan::New(NodeRequest::Create(this, resource)); + v8::Local requestHandle = NodeRequest::Create(this, resource)->ToObject(); pending.emplace(resource, requestHandle); v8::Local argv[] = { requestHandle }; diff --git a/platform/node/src/node_mapbox_gl_native.cpp b/platform/node/src/node_mapbox_gl_native.cpp index b631b32c54f..c0fb47d1448 100644 --- a/platform/node/src/node_mapbox_gl_native.cpp +++ b/platform/node/src/node_mapbox_gl_native.cpp @@ -59,7 +59,7 @@ NAN_MODULE_INIT(RegisterModule) { Nan::SetPrototype(target, Nan::Get(EventEmitter, Nan::New("prototype").ToLocalChecked()).ToLocalChecked()); - mbgl::Log::setObserver(std::make_unique(Nan::New(target))); + mbgl::Log::setObserver(std::make_unique(target->ToObject())); } NODE_MODULE(mapbox_gl_native, RegisterModule)