From 1a783ed8f2b7d516f5d1f588eb5a6746bfc388fb Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Aug 18 2020 16:27:09 +0000 Subject: Orphaned for 6+ weeks --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 86369ee..0000000 --- a/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -/mapnik-1.0.0.tgz -/mapnik-1.1.0.tgz -/mapnik-1.1.1.tgz -/mapnik-1.1.2.tgz -/mapnik-1.1.3.tgz -/mapnik-1.2.0.tgz -/mapnik-1.2.1.tgz -/mapnik-1.2.2.tgz -/mapnik-1.2.3.tgz -/mapnik-1.3.0.tgz -/mapnik-1.3.1.tgz -/mapnik-1.3.2.tgz -/mapnik-1.3.4.tgz -/mapnik-1.4.0.tgz -/nodejs-mapnik-1.4.0-9ca8720.tar.gz -/node-mapnik-549e90e01cdb071abe4db3ba512036928241079d.tar.gz -/node-mapnik-68524228034eadf95fe1c69852d752a542b3f0a5.tar.gz -/node-mapnik-0c39be780741d47b60e35523c6cde7e3dae5b20a.tar.gz -/node-mapnik-9711f6561d1bb3965a98d6ac638c0e44f9915d5a.tar.gz -/node-mapnik-ae61e6df4a6150089935ff8a3ae098eef3d0c839.tar.gz -/node-mapnik-640482f40ccb8883fbfaebe2377a52a62507ef2c.tar.gz -/node-mapnik-153a1f17ba8dd51763aca62365079c402635e868.tar.gz -/node-mapnik-a897fd27abf4f57be6c3b162cb838f694614bf00.tar.gz -/node-mapnik-bee84c5a1da8c296f97b1d0afdfa0c7bf79148dc.tar.gz -/nodejs-mapnik-3.4.11.tar.gz -/nodejs-mapnik-3.4.12.tar.gz -/nodejs-mapnik-3.4.13.tar.gz -/nodejs-mapnik-3.4.14.tar.gz -/nodejs-mapnik-3.4.15.tar.gz -/nodejs-mapnik-3.4.16.tar.gz -/nodejs-mapnik-3.5.0.tar.gz -/nodejs-mapnik-3.5.1.tar.gz -/nodejs-mapnik-3.5.2.tar.gz -/nodejs-mapnik-3.5.4.tar.gz -/nodejs-mapnik-3.5.5.tar.gz -/nodejs-mapnik-3.5.6.tar.gz -/nodejs-mapnik-3.5.8.tar.gz -/nodejs-mapnik-3.5.10.tar.gz -/nodejs-mapnik-3.5.11.tar.gz -/nodejs-mapnik-3.5.12.tar.gz -/nodejs-mapnik-3.5.14.tar.gz -/nodejs-mapnik-3.6.0.tar.gz -/nodejs-mapnik-3.6.1.tar.gz -/nodejs-mapnik-3.6.2.tar.gz -/nodejs-mapnik-3.7.0.tar.gz -/nodejs-mapnik-3.7.1.tar.gz -/nodejs-mapnik-3.7.2.tar.gz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..5204a84 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Orphaned for 6+ weeks diff --git a/nodejs-mapnik-boost.patch b/nodejs-mapnik-boost.patch deleted file mode 100644 index 044e0f2..0000000 --- a/nodejs-mapnik-boost.patch +++ /dev/null @@ -1,37 +0,0 @@ -commit 62cc1e270f1b71e925f6fb8674c8d88372201c4f -Author: Tom Hughes -Date: Tue Feb 27 09:29:42 2018 +0000 - - Patch some test differences for boost 1.66.0 - -diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js -index 2754038c..2ee4c47f 100644 ---- a/test/vector-tile.test.js -+++ b/test/vector-tile.test.js -@@ -2225,7 +2225,7 @@ describe('mapnik.VectorTile ', function() { - map.render(vtile, opts, function(err, vtile) { - if (err) throw err; - if (hasBoostSimple) { -- assert.equal(vtile.reportGeometrySimplicity().length, 0); -+ assert.equal(vtile.reportGeometrySimplicity().length, 1); - assert.equal(vtile.reportGeometryValidity().length, 25); // Dataset not expected to be OGC valid - assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); - } -@@ -2263,7 +2263,7 @@ describe('mapnik.VectorTile ', function() { - map.render(vtile, opts, function(err, vtile) { - if (err) throw err; - if (hasBoostSimple) { -- assert.equal(vtile.reportGeometrySimplicity().length, 0); -+ assert.equal(vtile.reportGeometrySimplicity().length, 1); - assert.equal(vtile.reportGeometryValidity().length, 25); // Dataset not expected to be OGC valid - assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); - } -@@ -3555,7 +3555,7 @@ describe('mapnik.VectorTile ', function() { - 'landcover', 'hillshade', 'contour']); - assert.equal(vtile.reportGeometryValidity().length, 0); - assert.equal(vtile.reportGeometryValidity({split_multi_features:true}).length, 0); -- assert.equal(vtile.reportGeometrySimplicity().length, 4); -+ assert.equal(vtile.reportGeometrySimplicity().length, 6); - done(); - }); - }); diff --git a/nodejs-mapnik-gdal.patch b/nodejs-mapnik-gdal.patch deleted file mode 100644 index 983bd1d..0000000 --- a/nodejs-mapnik-gdal.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 719a4f385cfe431a9d42c18943c3e87d0d4ac405 -Author: Tom Hughes -Date: Tue Jan 29 10:00:16 2019 +0000 - - Patch some test differences for gdal 2.3.x - -diff --git a/test/datasource.test.js b/test/datasource.test.js -index 710f1891..dd2f85df 100644 ---- a/test/datasource.test.js -+++ b/test/datasource.test.js -@@ -85,7 +85,7 @@ describe('mapnik.Datasource', function() { - LAT: 'Number' - }, - geometry_type: 'polygon', -- proj4:'+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs' -+ proj4:'+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs' - }; - var actual = ds.describe(); - assert.equal(actual.proj4, expected.proj4); diff --git a/nodejs-mapnik-global-namespace.patch b/nodejs-mapnik-global-namespace.patch deleted file mode 100644 index 38f1271..0000000 --- a/nodejs-mapnik-global-namespace.patch +++ /dev/null @@ -1,45 +0,0 @@ -commit 9d708a233ead292706666ce68d13f4ad6a380a3f -Author: Tom Hughes -Date: Thu May 4 09:56:30 2017 +0100 - - Use modules from the global namespace - -diff --git a/package.json b/package.json -index 86a12199..24742c67 100644 ---- a/package.json -+++ b/package.json -@@ -59,7 +59,7 @@ - "aws-sdk": "2.0.12", - "jshint": "^2.5.10", - "mocha": "2.x", -- "@mapbox/sphericalmercator": "~1.0.2", -+ "sphericalmercator": "~1.0.2", - "bytes": "~2.1.0" - }, - "jshintConfig": { -diff --git a/test/vector-tile.composite.test.js b/test/vector-tile.composite.test.js -index 985bac2f..38f75260 100644 ---- a/test/vector-tile.composite.test.js -+++ b/test/vector-tile.composite.test.js -@@ -5,7 +5,7 @@ var assert = require('assert'); - var util = require('util'); - var fs = require('fs'); - var path = require('path'); --var mercator = new(require('@mapbox/sphericalmercator'))(); -+var mercator = new(require('sphericalmercator'))(); - var existsSync = require('fs').existsSync || require('path').existsSync; - var overwrite_expected_data = false; - -diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js -index e1c0ab1b..2754038c 100644 ---- a/test/vector-tile.test.js -+++ b/test/vector-tile.test.js -@@ -4,7 +4,7 @@ var mapnik = require('../'); - var assert = require('assert'); - var fs = require('fs'); - var path = require('path'); --var mercator = new(require('@mapbox/sphericalmercator'))(); -+var mercator = new(require('sphericalmercator'))(); - var existsSync = require('fs').existsSync || require('path').existsSync; - var overwrite_expected_data = false; - var zlib = require('zlib'); diff --git a/nodejs-mapnik-node10.patch b/nodejs-mapnik-node10.patch deleted file mode 100644 index e12c576..0000000 --- a/nodejs-mapnik-node10.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp -index 4aff65ff..5f0313d0 100644 ---- a/src/mapnik_image.cpp -+++ b/src/mapnik_image.cpp -@@ -3220,8 +3220,9 @@ void Image::EIO_AfterFromSVGBytes(uv_work_t* req) - { - Image* im = new Image(closure->im); - v8::Local ext = Nan::New(im); -- v8::Local image_obj = Nan::New(constructor)->GetFunction()->NewInstance(1, &ext); -- v8::Local argv[2] = { Nan::Null(), image_obj }; -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); -+ v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; - Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->cb.Reset(); -diff --git a/src/utils.hpp b/src/utils.hpp -index 643679e7..00d577f8 100644 ---- a/src/utils.hpp -+++ b/src/utils.hpp -@@ -18,7 +18,7 @@ - #include - #include - --#define TOSTR(obj) (*v8::String::Utf8Value((obj)->ToString())) -+#define TOSTR(obj) (*Nan::Utf8String(obj)) - - #define FUNCTION_ARG(I, VAR) \ - if (info.Length() <= (I) || !info[I]->IsFunction()) { \ -diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js -index eb5ae3e3..8f1f3b41 100644 ---- a/test/vector-tile.test.js -+++ b/test/vector-tile.test.js -@@ -797,59 +797,59 @@ describe('mapnik.VectorTile ', function() { - var data = fs.readFileSync("./test/data/vector_tile/tile1.vector.pbf"); - vtile.setData(data); - assert.throws( -- function() { vtile.getDataSync(null); }, -+ function() { vtile.getDataSync(null); }, null, - "first arg must be a options object" - ); - assert.throws( -- function() { vtile.getData(null, function(err, out) {}); }, -+ function() { vtile.getData(null, function(err, out) {}); }, null, - "first arg must be a options object" - ); - assert.throws( -- function() { vtile.getDataSync({compression:null}); }, -+ function() { vtile.getDataSync({compression:null}); }, null, - "option 'compression' must be a string, either 'gzip', or 'none' (default)" - ); - assert.throws( -- function() { vtile.getData({compression:null}, function(err,out) {}); }, -+ function() { vtile.getData({compression:null}, function(err,out) {}); }, null, - "option 'compression' must be a string, either 'gzip', or 'none' (default)" - ); - assert.throws( -- function() { vtile.getDataSync({level:null}); }, -+ function() { vtile.getDataSync({level:null}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getData({level:null}, function(err,out) {}); }, -+ function() { vtile.getData({level:null}, function(err,out) {}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getDataSync({level:99}); }, -+ function() { vtile.getDataSync({level:99}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getData({level:99}, function(err,out) {}); }, -+ function() { vtile.getData({level:99}, function(err,out) {}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getDataSync({level:-1}); }, -+ function() { vtile.getDataSync({level:-1}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getData({level:-1}, function(err,out) {}); }, -+ function() { vtile.getData({level:-1}, function(err,out) {}); }, null, - "option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive" - ); - assert.throws( -- function() { vtile.getDataSync({strategy:null}); }, -+ function() { vtile.getDataSync({strategy:null}); }, null, - "option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT" - ); - assert.throws( -- function() { vtile.getData({strategy:null}, function(err,out) {}); }, -+ function() { vtile.getData({strategy:null}, function(err,out) {}); }, null, - "option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT" - ); - assert.throws( -- function() { vtile.getDataSync({strategy:'FOO'}); }, -+ function() { vtile.getDataSync({strategy:'FOO'}); }, null, - "option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT" - ); - assert.throws( -- function() { vtile.getData({strategy:'FOO'}, function(err,out) {}); }, -+ function() { vtile.getData({strategy:'FOO'}, function(err,out) {}); }, null, - "option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT" - ); - }); diff --git a/nodejs-mapnik-node12.patch b/nodejs-mapnik-node12.patch deleted file mode 100644 index f2639f8..0000000 --- a/nodejs-mapnik-node12.patch +++ /dev/null @@ -1,7309 +0,0 @@ -commit 258df75b250b6dfdcc09bfe68157cf405db9832f -Author: Raul Marin -Date: Mon May 27 13:33:36 2019 +0200 - - Patch for Node 12.x support - -diff --git a/package.json b/package.json -index 8eb1b21d..bc1e7a8e 100644 ---- a/package.json -+++ b/package.json -@@ -38,7 +38,7 @@ - "dependencies": { - "mapnik-vector-tile": "1.6.1", - "protozero": "1.5.1", -- "nan": "~2.8.0" -+ "nan": "~2.14.0" - }, - "bundledDependencies": [ - "node-pre-gyp" -diff --git a/src/blend.cpp b/src/blend.cpp -index 8b463eab..b4f0e2af 100644 ---- a/src/blend.cpp -+++ b/src/blend.cpp -@@ -69,16 +69,15 @@ NAN_METHOD(rgb2hsl) { - Nan::ThrowTypeError("Please pass r,g,b integer values as three arguments"); - return; - } -- unsigned r,g,b; -- r = info[0]->IntegerValue(); -- g = info[1]->IntegerValue(); -- b = info[2]->IntegerValue(); -+ std::uint32_t r = Nan::To(info[0]).FromJust(); -+ std::uint32_t g = Nan::To(info[1]).FromJust(); -+ std::uint32_t b = Nan::To(info[2]).FromJust(); - v8::Local hsl = Nan::New(3); - double h,s,l; - rgb_to_hsl(r,g,b,h,s,l); -- hsl->Set(0,Nan::New(h)); -- hsl->Set(1,Nan::New(s)); -- hsl->Set(2,Nan::New(l)); -+ Nan::Set(hsl, 0,Nan::New(h)); -+ Nan::Set(hsl, 1,Nan::New(s)); -+ Nan::Set(hsl, 2,Nan::New(l)); - info.GetReturnValue().Set(hsl); - } - -@@ -92,55 +91,55 @@ NAN_METHOD(hsl2rgb) { - return; - } - double h,s,l; -- h = info[0]->NumberValue(); -- s = info[1]->NumberValue(); -- l = info[2]->NumberValue(); -+ h = Nan::To(info[0]).FromJust(); -+ s = Nan::To(info[1]).FromJust(); -+ l = Nan::To(info[2]).FromJust(); - v8::Local rgb = Nan::New(3); - unsigned r,g,b; - hsl_to_rgb(h,s,l,r,g,b); -- rgb->Set(0,Nan::New(r)); -- rgb->Set(1,Nan::New(g)); -- rgb->Set(2,Nan::New(b)); -+ Nan::Set(rgb, 0, Nan::New(r)); -+ Nan::Set(rgb, 1, Nan::New(g)); -+ Nan::Set(rgb, 2, Nan::New(b)); - info.GetReturnValue().Set(rgb); - } - - static void parseTintOps(v8::Local const& tint, Tinter & tinter, std::string & msg) { - Nan::HandleScope scope; -- v8::Local hue = tint->Get(Nan::New("h").ToLocalChecked()); -+ v8::Local hue = Nan::Get(tint, Nan::New("h").ToLocalChecked()).ToLocalChecked(); - if (!hue.IsEmpty() && hue->IsArray()) { - v8::Local val_array = v8::Local::Cast(hue); - if (val_array->Length() != 2) { - msg = "h array must be a pair of values"; - } -- tinter.h0 = val_array->Get(0)->NumberValue(); -- tinter.h1 = val_array->Get(1)->NumberValue(); -+ tinter.h0 = Nan::To(Nan::Get(val_array, 0).ToLocalChecked()).FromJust(); -+ tinter.h1 = Nan::To(Nan::Get(val_array, 1).ToLocalChecked()).FromJust(); - } -- v8::Local sat = tint->Get(Nan::New("s").ToLocalChecked()); -+ v8::Local sat = Nan::Get(tint, Nan::New("s").ToLocalChecked()).ToLocalChecked(); - if (!sat.IsEmpty() && sat->IsArray()) { - v8::Local val_array = v8::Local::Cast(sat); - if (val_array->Length() != 2) { - msg = "s array must be a pair of values"; - } -- tinter.s0 = val_array->Get(0)->NumberValue(); -- tinter.s1 = val_array->Get(1)->NumberValue(); -+ tinter.s0 = Nan::To(Nan::Get(val_array, 0).ToLocalChecked()).FromJust(); -+ tinter.s1 = Nan::To(Nan::Get(val_array, 1).ToLocalChecked()).FromJust(); - } -- v8::Local light = tint->Get(Nan::New("l").ToLocalChecked()); -+ v8::Local light = Nan::Get(tint, Nan::New("l").ToLocalChecked()).ToLocalChecked(); - if (!light.IsEmpty() && light->IsArray()) { - v8::Local val_array = v8::Local::Cast(light); - if (val_array->Length() != 2) { - msg = "l array must be a pair of values"; - } -- tinter.l0 = val_array->Get(0)->NumberValue(); -- tinter.l1 = val_array->Get(1)->NumberValue(); -+ tinter.l0 = Nan::To(Nan::Get(val_array, 0).ToLocalChecked()).FromJust(); -+ tinter.l1 = Nan::To(Nan::Get(val_array, 1).ToLocalChecked()).FromJust(); - } -- v8::Local alpha = tint->Get(Nan::New("a").ToLocalChecked()); -+ v8::Local alpha = Nan::Get(tint, Nan::New("a").ToLocalChecked()).ToLocalChecked(); - if (!alpha.IsEmpty() && alpha->IsArray()) { - v8::Local val_array = v8::Local::Cast(alpha); - if (val_array->Length() != 2) { - msg = "a array must be a pair of values"; - } -- tinter.a0 = val_array->Get(0)->NumberValue(); -- tinter.a1 = val_array->Get(1)->NumberValue(); -+ tinter.a0 = Nan::To(Nan::Get(val_array, 0).ToLocalChecked()).FromJust(); -+ tinter.a1 = Nan::To(Nan::Get(val_array, 1).ToLocalChecked()).FromJust(); - } - } - -@@ -421,6 +420,7 @@ void Work_Blend(uv_work_t* req) - void Work_AfterBlend(uv_work_t* req) { - Nan::HandleScope scope; - BlendBaton* baton = static_cast(req->data); -+ Nan::AsyncResource async_resource(__func__); - - if (!baton->message.length()) { - std::string result = baton->stream.str(); -@@ -428,12 +428,12 @@ void Work_AfterBlend(uv_work_t* req) { - Nan::Null(), - Nan::CopyBuffer((char *)result.data(), mapnik::safe_cast(result.length())).ToLocalChecked(), - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 2, argv); - } else { - v8::Local argv[] = { - Nan::Error(baton->message.c_str()) - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 1, argv); - } - delete baton; - } -@@ -493,9 +493,9 @@ NAN_METHOD(Blend) { - - // Validate options - if (!options.IsEmpty()) { -- baton->quality = options->Get(Nan::New("quality").ToLocalChecked())->Int32Value(); -+ baton->quality = Nan::To(Nan::Get(options, Nan::New("quality").ToLocalChecked()).ToLocalChecked()).FromJust(); - -- v8::Local format_val = options->Get(Nan::New("format").ToLocalChecked()); -+ v8::Local format_val = Nan::Get(options, Nan::New("format").ToLocalChecked()).ToLocalChecked(); - if (!format_val.IsEmpty() && format_val->IsString()) { - std::string format_val_string = TOSTR(format_val); - if (format_val_string == "jpeg" || format_val_string == "jpg") { -@@ -523,13 +523,13 @@ NAN_METHOD(Blend) { - } - } - -- baton->reencode = options->Get(Nan::New("reencode").ToLocalChecked())->BooleanValue(); -- baton->width = options->Get(Nan::New("width").ToLocalChecked())->Int32Value(); -- baton->height = options->Get(Nan::New("height").ToLocalChecked())->Int32Value(); -+ baton->reencode = Nan::To(Nan::Get(options, Nan::New("reencode").ToLocalChecked()).ToLocalChecked()).FromJust(); -+ baton->width = Nan::To(Nan::Get(options, Nan::New("width").ToLocalChecked()).ToLocalChecked()).FromJust(); -+ baton->height = Nan::To(Nan::Get(options, Nan::New("height").ToLocalChecked()).ToLocalChecked()).FromJust(); - -- v8::Local matte_val = options->Get(Nan::New("matte").ToLocalChecked()); -+ v8::Local matte_val = Nan::Get(options, Nan::New("matte").ToLocalChecked()).ToLocalChecked(); - if (!matte_val.IsEmpty() && matte_val->IsString()) { -- if (!hexToUInt32Color(*v8::String::Utf8Value(matte_val->ToString()), baton->matte)) -+ if (!hexToUInt32Color(TOSTR(matte_val->ToString(Nan::GetCurrentContext()).ToLocalChecked()), baton->matte)) - { - Nan::ThrowTypeError("Invalid batte provided."); - return; -@@ -541,12 +541,12 @@ NAN_METHOD(Blend) { - } - } - -- v8::Local palette_val = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local palette_val = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!palette_val.IsEmpty() && palette_val->IsObject()) { -- baton->palette = Nan::ObjectWrap::Unwrap(palette_val->ToObject())->palette(); -+ baton->palette = Nan::ObjectWrap::Unwrap(palette_val->ToObject(Nan::GetCurrentContext()).ToLocalChecked())->palette(); - } - -- v8::Local mode_val = options->Get(Nan::New("mode").ToLocalChecked()); -+ v8::Local mode_val = Nan::Get(options, Nan::New("mode").ToLocalChecked()).ToLocalChecked(); - if (!mode_val.IsEmpty() && mode_val->IsString()) { - std::string mode_string = TOSTR(mode_val); - if (mode_string == "octree" || mode_string == "o") { -@@ -557,11 +557,11 @@ NAN_METHOD(Blend) { - } - } - -- if (options->Has(Nan::New("compression").ToLocalChecked())) { -- v8::Local compression_val = options->Get(Nan::New("compression").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("compression").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local compression_val = Nan::Get(options, Nan::New("compression").ToLocalChecked()).ToLocalChecked(); - if (!compression_val.IsEmpty() && compression_val->IsNumber()) - { -- baton->compression = compression_val->Int32Value(); -+ baton->compression = Nan::To(compression_val).FromJust(); - } - else - { -@@ -594,14 +594,15 @@ NAN_METHOD(Blend) { - Nan::ThrowTypeError("First argument must contain at least one Buffer."); - return; - } else if (length == 1 && !baton->reencode) { -- v8::Local buffer = js_images->Get(0); -+ v8::Local buffer = Nan::Get(js_images, 0).ToLocalChecked(); - if (node::Buffer::HasInstance(buffer)) { - // Directly pass through buffer if it's the only one. - v8::Local argv[] = { - Nan::Null(), - buffer - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 2, argv); -+ Nan::AsyncResource async_resource(__func__); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(baton->callback), 2, argv); - return; - } else { - // Check whether the argument is a complex image with offsets etc. -@@ -609,9 +610,9 @@ NAN_METHOD(Blend) { - // process below. - bool valid = false; - if (buffer->IsObject()) { -- v8::Local props = buffer->ToObject(); -- valid = props->Has(Nan::New("buffer").ToLocalChecked()) && -- node::Buffer::HasInstance(props->Get(Nan::New("buffer").ToLocalChecked())); -+ v8::Local props = buffer->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ valid = Nan::Has(props, Nan::New("buffer").ToLocalChecked()).FromMaybe(false) && -+ node::Buffer::HasInstance(Nan::Get(props, Nan::New("buffer").ToLocalChecked()).ToLocalChecked()); - } - if (!valid) { - Nan::ThrowTypeError("All elements must be Buffers or objects with a 'buffer' property."); -@@ -632,23 +633,23 @@ NAN_METHOD(Blend) { - - for (uint32_t i = 0; i < length; ++i) { - ImagePtr image = std::make_shared(); -- v8::Local buffer = js_images->Get(i); -+ v8::Local buffer = Nan::Get(js_images, i).ToLocalChecked(); - if (node::Buffer::HasInstance(buffer)) { - image->buffer.Reset(buffer.As()); - } else if (buffer->IsObject()) { -- v8::Local props = buffer->ToObject(); -- if (props->Has(Nan::New("buffer").ToLocalChecked())) { -- buffer = props->Get(Nan::New("buffer").ToLocalChecked()); -+ v8::Local props = buffer->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(props, Nan::New("buffer").ToLocalChecked()).FromMaybe(false)) { -+ buffer = Nan::Get(props, Nan::New("buffer").ToLocalChecked()).ToLocalChecked(); - if (node::Buffer::HasInstance(buffer)) { - image->buffer.Reset(buffer.As()); - } - } -- image->x = props->Get(Nan::New("x").ToLocalChecked())->Int32Value(); -- image->y = props->Get(Nan::New("y").ToLocalChecked())->Int32Value(); -+ image->x = Nan::To(Nan::Get(props, Nan::New("x").ToLocalChecked()).ToLocalChecked()).FromJust(); -+ image->y = Nan::To(Nan::Get(props, Nan::New("y").ToLocalChecked()).ToLocalChecked()).FromJust(); - -- v8::Local tint_val = props->Get(Nan::New("tint").ToLocalChecked()); -+ v8::Local tint_val = Nan::Get(props, Nan::New("tint").ToLocalChecked()).ToLocalChecked(); - if (!tint_val.IsEmpty() && tint_val->IsObject()) { -- v8::Local tint = tint_val->ToObject(); -+ v8::Local tint = tint_val->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (!tint.IsEmpty()) { - baton->reencode = true; - std::string msg; -diff --git a/src/ds_emitter.hpp b/src/ds_emitter.hpp -index 256ab685..e469aea3 100644 ---- a/src/ds_emitter.hpp -+++ b/src/ds_emitter.hpp -@@ -42,8 +42,8 @@ static void get_fields(v8::Local fields, mapnik::datasource_ptr ds) - else if (field_type == mapnik::Object) type = "Object"; - else type = "Unknown"; - std::string const& name = attr_info.get_name(); -- fields->Set(Nan::New(name).ToLocalChecked(), Nan::New(type).ToLocalChecked()); -- fields->Set(Nan::New(name).ToLocalChecked(), Nan::New(type).ToLocalChecked()); -+ Nan::Set(fields, Nan::New(name).ToLocalChecked(), Nan::New(type).ToLocalChecked()); -+ Nan::Set(fields, Nan::New(name).ToLocalChecked(), Nan::New(type).ToLocalChecked()); - /* LCOV_EXCL_STOP */ - } - } -@@ -55,22 +55,22 @@ static void describe_datasource(v8::Local description, mapnik::datas - // type - if (ds->type() == mapnik::datasource::Raster) - { -- description->Set(Nan::New("type").ToLocalChecked(), Nan::New("raster").ToLocalChecked()); -+ Nan::Set(description, Nan::New("type").ToLocalChecked(), Nan::New("raster").ToLocalChecked()); - } - else - { -- description->Set(Nan::New("type").ToLocalChecked(), Nan::New("vector").ToLocalChecked()); -+ Nan::Set(description, Nan::New("type").ToLocalChecked(), Nan::New("vector").ToLocalChecked()); - } - - mapnik::layer_descriptor ld = ds->get_descriptor(); - - // encoding -- description->Set(Nan::New("encoding").ToLocalChecked(), Nan::New(ld.get_encoding().c_str()).ToLocalChecked()); -+ Nan::Set(description, Nan::New("encoding").ToLocalChecked(), Nan::New(ld.get_encoding().c_str()).ToLocalChecked()); - - // field names and types - v8::Local fields = Nan::New(); - node_mapnik::get_fields(fields, ds); -- description->Set(Nan::New("fields").ToLocalChecked(), fields); -+ Nan::Set(description, Nan::New("fields").ToLocalChecked(), fields); - - v8::Local js_type = Nan::New("unknown").ToLocalChecked(); - if (ds->type() == mapnik::datasource::Raster) -@@ -112,7 +112,7 @@ static void describe_datasource(v8::Local description, mapnik::datas - } - } - } -- description->Set(Nan::New("geometry_type").ToLocalChecked(), js_type); -+ Nan::Set(description, Nan::New("geometry_type").ToLocalChecked(), js_type); - for (auto const& param : ld.get_extra_parameters()) - { - node_mapnik::params_to_object(description,param.first, param.second); -diff --git a/src/js_grid_utils.hpp b/src/js_grid_utils.hpp -index d4455f52..36ecb781 100644 ---- a/src/js_grid_utils.hpp -+++ b/src/js_grid_utils.hpp -@@ -116,13 +116,13 @@ static void write_features(T const& grid_type, - { - if (attr == "__id__") - { -- feat->Set(Nan::New(attr).ToLocalChecked(), Nan::New(feature->id())); -+ Nan::Set(feat, Nan::New(attr).ToLocalChecked(), Nan::New(feature->id())); - } - else if (feature->has_key(attr)) - { - found = true; - mapnik::feature_impl::value_type const& attr_val = feature->get(attr); -- feat->Set(Nan::New(attr).ToLocalChecked(), -+ Nan::Set(feat, Nan::New(attr).ToLocalChecked(), - mapnik::util::apply_visitor(node_mapnik::value_converter(), - attr_val)); - } -@@ -130,7 +130,7 @@ static void write_features(T const& grid_type, - - if (found) - { -- feature_data->Set(Nan::New(feat_itr->first).ToLocalChecked(), feat); -+ Nan::Set(feature_data, Nan::New(feat_itr->first).ToLocalChecked(), feat); - } - } - } -diff --git a/src/mapnik_cairo_surface.cpp b/src/mapnik_cairo_surface.cpp -index 0cd40627..ec0705cd 100644 ---- a/src/mapnik_cairo_surface.cpp -+++ b/src/mapnik_cairo_surface.cpp -@@ -13,7 +13,7 @@ void CairoSurface::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "width", width); - Nan::SetPrototypeMethod(lcons, "height", height); - Nan::SetPrototypeMethod(lcons, "getData", getData); -- target->Set(Nan::New("CairoSurface").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("CairoSurface").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -64,7 +64,7 @@ NAN_METHOD(CairoSurface::New) - Nan::ThrowTypeError("CairoSurface 'width' and 'height' must be a integers"); - return; - } -- CairoSurface* im = new CairoSurface(format, info[1]->IntegerValue(), info[2]->IntegerValue()); -+ CairoSurface* im = new CairoSurface(format, Nan::To(info[1]).FromJust(), Nan::To(info[2]).FromJust()); - im->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - return; -diff --git a/src/mapnik_color.cpp b/src/mapnik_color.cpp -index 7be4ff23..f5b8b330 100644 ---- a/src/mapnik_color.cpp -+++ b/src/mapnik_color.cpp -@@ -48,7 +48,7 @@ void Color::Initialize(v8::Local target) { - ATTR(lcons, "a", get_prop, set_prop); - ATTR(lcons, "premultiplied", get_premultiplied, set_premultiplied); - -- target->Set(Nan::New("Color").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Color").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -90,16 +90,16 @@ NAN_METHOD(Color::New) - info[0]->IsString() && - info[1]->IsBoolean()) - { -- c_p = std::make_shared(TOSTR(info[0]),info[1]->BooleanValue()); -+ c_p = std::make_shared(TOSTR(info[0]),Nan::To(info[1]).FromJust()); - } - else if (info.Length() == 3 && - info[0]->IsNumber() && - info[1]->IsNumber() && - info[2]->IsNumber()) - { -- int r = info[0]->IntegerValue(); -- int g = info[1]->IntegerValue(); -- int b = info[2]->IntegerValue(); -+ int r = Nan::To(info[0]).FromJust(); -+ int g = Nan::To(info[1]).FromJust(); -+ int b = Nan::To(info[2]).FromJust(); - if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) - { - Nan::ThrowTypeError("color value out of range"); -@@ -113,15 +113,15 @@ NAN_METHOD(Color::New) - info[2]->IsNumber() && - info[3]->IsBoolean()) - { -- int r = info[0]->IntegerValue(); -- int g = info[1]->IntegerValue(); -- int b = info[2]->IntegerValue(); -+ int r = Nan::To(info[0]).FromJust(); -+ int g = Nan::To(info[1]).FromJust(); -+ int b = Nan::To(info[2]).FromJust(); - if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) - { - Nan::ThrowTypeError("color value out of range"); - return; - } -- c_p = std::make_shared(r,g,b,255,info[3]->BooleanValue()); -+ c_p = std::make_shared(r,g,b,255,Nan::To(info[3]).FromJust()); - } - else if (info.Length() == 4 && - info[0]->IsNumber() && -@@ -129,10 +129,10 @@ NAN_METHOD(Color::New) - info[2]->IsNumber() && - info[3]->IsNumber()) - { -- int r = info[0]->IntegerValue(); -- int g = info[1]->IntegerValue(); -- int b = info[2]->IntegerValue(); -- int a = info[3]->IntegerValue(); -+ int r = Nan::To(info[0]).FromJust(); -+ int g = Nan::To(info[1]).FromJust(); -+ int b = Nan::To(info[2]).FromJust(); -+ int a = Nan::To(info[3]).FromJust(); - if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) - { - Nan::ThrowTypeError("color value out of range"); -@@ -147,16 +147,16 @@ NAN_METHOD(Color::New) - info[3]->IsNumber() && - info[4]->IsBoolean()) - { -- int r = info[0]->IntegerValue(); -- int g = info[1]->IntegerValue(); -- int b = info[2]->IntegerValue(); -- int a = info[3]->IntegerValue(); -+ int r = Nan::To(info[0]).FromJust(); -+ int g = Nan::To(info[1]).FromJust(); -+ int b = Nan::To(info[2]).FromJust(); -+ int a = Nan::To(info[3]).FromJust(); - if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) - { - Nan::ThrowTypeError("color value out of range"); - return; - } -- c_p = std::make_shared(r,g,b,a,info[4]->BooleanValue()); -+ c_p = std::make_shared(r,g,b,a,Nan::To(info[4]).FromJust()); - } - else - { -@@ -183,7 +183,7 @@ v8::Local Color::NewInstance(mapnik::color const& color) { - Color* c = new Color(); - c->this_ = std::make_shared(color); - v8::Local ext = Nan::New(c); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Color instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -211,7 +211,7 @@ NAN_SETTER(Color::set_prop) - Nan::ThrowTypeError("color channel value must be an integer"); - return; - } -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val < 0 || val > 255) - { - Nan::ThrowTypeError("Value out of range for color channel"); -@@ -264,7 +264,7 @@ NAN_SETTER(Color::set_premultiplied) - Nan::ThrowTypeError("Value set to premultiplied must be a boolean"); - return; - } -- c->get()->set_premultiplied(value->BooleanValue()); -+ c->get()->set_premultiplied(Nan::To(value).FromJust()); - } - - /** -diff --git a/src/mapnik_datasource.cpp b/src/mapnik_datasource.cpp -index 881249a2..5cd40a22 100644 ---- a/src/mapnik_datasource.cpp -+++ b/src/mapnik_datasource.cpp -@@ -41,7 +41,7 @@ void Datasource::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "extent", extent); - Nan::SetPrototypeMethod(lcons, "fields", fields); - -- target->Set(Nan::New("Datasource").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Datasource").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -68,12 +68,12 @@ NAN_METHOD(Datasource::New) - Datasource* d = static_cast(ptr); - if (d->datasource_->type() == mapnik::datasource::Raster) - { -- info.This()->Set(Nan::New("type").ToLocalChecked(), -+ Nan::Set(info.This(), Nan::New("type").ToLocalChecked(), - Nan::New("raster").ToLocalChecked()); - } - else - { -- info.This()->Set(Nan::New("type").ToLocalChecked(), -+ Nan::Set(info.This(), Nan::New("type").ToLocalChecked(), - Nan::New("vector").ToLocalChecked()); - } - d->Wrap(info.This()); -@@ -95,12 +95,12 @@ NAN_METHOD(Datasource::New) - v8::Local options = info[0].As(); - - mapnik::parameters params; -- v8::Local names = options->GetPropertyNames(); -+ v8::Local names = Nan::GetPropertyNames(options).ToLocalChecked(); - unsigned int i = 0; - unsigned int a_length = names->Length(); - while (i < a_length) { -- v8::Local name = names->Get(i)->ToString(); -- v8::Local value = options->Get(name); -+ v8::Local name = Nan::Get(names, i).ToLocalChecked()->ToString(Nan::GetCurrentContext()).ToLocalChecked(); -+ v8::Local value = Nan::Get(options, name).ToLocalChecked(); - // TODO - don't treat everything as strings - params[TOSTR(name)] = const_cast(TOSTR(value)); - i++; -@@ -121,12 +121,12 @@ NAN_METHOD(Datasource::New) - { - if (ds->type() == mapnik::datasource::Raster) - { -- info.This()->Set(Nan::New("type").ToLocalChecked(), -+ Nan::Set(info.This(), Nan::New("type").ToLocalChecked(), - Nan::New("raster").ToLocalChecked()); - } - else - { -- info.This()->Set(Nan::New("type").ToLocalChecked(), -+ Nan::Set(info.This(), Nan::New("type").ToLocalChecked(), - Nan::New("vector").ToLocalChecked()); - } - Datasource* d = new Datasource(); -@@ -147,7 +147,7 @@ v8::Local Datasource::NewInstance(mapnik::datasource_ptr ds_ptr) { - Datasource* d = new Datasource(); - d->datasource_ = ds_ptr; - v8::Local ext = Nan::New(d); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Datasource instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -194,10 +194,10 @@ NAN_METHOD(Datasource::extent) - } - - v8::Local a = Nan::New(4); -- a->Set(0, Nan::New(e.minx())); -- a->Set(1, Nan::New(e.miny())); -- a->Set(2, Nan::New(e.maxx())); -- a->Set(3, Nan::New(e.maxy())); -+ Nan::Set(a, 0, Nan::New(e.minx())); -+ Nan::Set(a, 1, Nan::New(e.miny())); -+ Nan::Set(a, 2, Nan::New(e.maxx())); -+ Nan::Set(a, 3, Nan::New(e.maxy())); - info.GetReturnValue().Set(a); - } - -@@ -263,10 +263,10 @@ NAN_METHOD(Datasource::featureset) - Nan::ThrowTypeError("optional second argument must be an options object"); - return; - } -- v8::Local options = info[0]->ToObject(); -- if (options->Has(Nan::New("extent").ToLocalChecked())) -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("extent").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local extent_opt = options->Get(Nan::New("extent").ToLocalChecked()); -+ v8::Local extent_opt = Nan::Get(options, Nan::New("extent").ToLocalChecked()).ToLocalChecked(); - if (!extent_opt->IsArray()) - { - Nan::ThrowTypeError("extent value must be an array of [minx,miny,maxx,maxy]"); -@@ -279,17 +279,17 @@ NAN_METHOD(Datasource::featureset) - Nan::ThrowTypeError("extent value must be an array of [minx,miny,maxx,maxy]"); - return; - } -- v8::Local minx = bbox->Get(0); -- v8::Local miny = bbox->Get(1); -- v8::Local maxx = bbox->Get(2); -- v8::Local maxy = bbox->Get(3); -+ v8::Local minx = Nan::Get(bbox, 0).ToLocalChecked(); -+ v8::Local miny = Nan::Get(bbox, 1).ToLocalChecked(); -+ v8::Local maxx = Nan::Get(bbox, 2).ToLocalChecked(); -+ v8::Local maxy = Nan::Get(bbox, 3).ToLocalChecked(); - if (!minx->IsNumber() || !miny->IsNumber() || !maxx->IsNumber() || !maxy->IsNumber()) - { - Nan::ThrowError("max_extent [minx,miny,maxx,maxy] must be numbers"); - return; - } -- extent = mapnik::box2d(minx->NumberValue(),miny->NumberValue(), -- maxx->NumberValue(),maxy->NumberValue()); -+ extent = mapnik::box2d(Nan::To(minx).FromJust(),Nan::To(miny).FromJust(), -+ Nan::To(maxx).FromJust(),Nan::To(maxy).FromJust()); - } - } - -diff --git a/src/mapnik_expression.cpp b/src/mapnik_expression.cpp -index 22235e07..50e720ad 100644 ---- a/src/mapnik_expression.cpp -+++ b/src/mapnik_expression.cpp -@@ -26,7 +26,7 @@ void Expression::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "toString", toString); - Nan::SetPrototypeMethod(lcons, "evaluate", evaluate); - -- target->Set(Nan::New("Expression").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Expression").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -99,17 +99,17 @@ NAN_METHOD(Expression::evaluate) - Nan::ThrowTypeError("optional second argument must be an options object"); - return; - } -- options = info[1]->ToObject(); -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(vars,bind_opt->ToObject()); -+ object_to_container(vars,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - } - mapnik::value value_obj = mapnik::util::apply_visitor(mapnik::evaluate(*(f->get()),vars),*(e->get())); -diff --git a/src/mapnik_feature.cpp b/src/mapnik_feature.cpp -index d2ac6a18..173bad91 100644 ---- a/src/mapnik_feature.cpp -+++ b/src/mapnik_feature.cpp -@@ -35,11 +35,11 @@ void Feature::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "geometry", geometry); - Nan::SetPrototypeMethod(lcons, "toJSON", toJSON); - -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromJSON", - Feature::fromJSON); - -- target->Set(Nan::New("Feature").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Feature").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -84,7 +84,7 @@ NAN_METHOD(Feature::New) - return; - } - -- Feature* f = new Feature(info[0]->IntegerValue()); -+ Feature* f = new Feature(Nan::To(info[0]).FromJust()); - f->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - } -@@ -114,7 +114,7 @@ NAN_METHOD(Feature::fromJSON) - } - Feature* feat = new Feature(f); - v8::Local ext = Nan::New(feat); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Feature instance"); - else info.GetReturnValue().Set(maybe_local.ToLocalChecked()); - } -@@ -134,7 +134,7 @@ v8::Local Feature::NewInstance(mapnik::feature_ptr f_ptr) - Nan::EscapableHandleScope scope; - Feature* f = new Feature(f_ptr); - v8::Local ext = Nan::New(f); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Feature instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -164,10 +164,10 @@ NAN_METHOD(Feature::extent) - Feature* fp = Nan::ObjectWrap::Unwrap(info.Holder()); - v8::Local a = Nan::New(4); - mapnik::box2d const& e = fp->get()->envelope(); -- a->Set(0, Nan::New(e.minx())); -- a->Set(1, Nan::New(e.miny())); -- a->Set(2, Nan::New(e.maxx())); -- a->Set(3, Nan::New(e.maxy())); -+ Nan::Set(a, 0, Nan::New(e.minx())); -+ Nan::Set(a, 1, Nan::New(e.miny())); -+ Nan::Set(a, 2, Nan::New(e.maxx())); -+ Nan::Set(a, 3, Nan::New(e.maxy())); - - info.GetReturnValue().Set(a); - } -@@ -189,7 +189,7 @@ NAN_METHOD(Feature::attributes) - { - for (auto const& attr : *feature) - { -- feat->Set(Nan::New(std::get<0>(attr)).ToLocalChecked(), -+ Nan::Set(feat, Nan::New(std::get<0>(attr)).ToLocalChecked(), - mapnik::util::apply_visitor(node_mapnik::value_converter(), std::get<1>(attr)) - ); - } -diff --git a/src/mapnik_featureset.cpp b/src/mapnik_featureset.cpp -index 3e1e50aa..f3f6a6e8 100644 ---- a/src/mapnik_featureset.cpp -+++ b/src/mapnik_featureset.cpp -@@ -20,7 +20,7 @@ void Featureset::Initialize(v8::Local target) { - - Nan::SetPrototypeMethod(lcons, "next", next); - -- target->Set(Nan::New("Featureset").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Featureset").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -98,7 +98,7 @@ v8::Local Featureset::NewInstance(mapnik::featureset_ptr fsp) - Featureset* fs = new Featureset(); - fs->this_ = fsp; - v8::Local ext = Nan::New(fs); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Featureset instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -diff --git a/src/mapnik_fonts.hpp b/src/mapnik_fonts.hpp -index 306aaf77..823467c8 100644 ---- a/src/mapnik_fonts.hpp -+++ b/src/mapnik_fonts.hpp -@@ -36,16 +36,16 @@ static inline NAN_METHOD(register_fonts) - } - - v8::Local options = info[1].As(); -- if (options->Has(Nan::New("recurse").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("recurse").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local recurse_opt = options->Get(Nan::New("recurse").ToLocalChecked()); -+ v8::Local recurse_opt = Nan::Get(options, Nan::New("recurse").ToLocalChecked()).ToLocalChecked(); - if (!recurse_opt->IsBoolean()) - { - Nan::ThrowTypeError("'recurse' must be a Boolean"); - return; - } - -- bool recurse = recurse_opt->BooleanValue(); -+ bool recurse = Nan::To(recurse_opt).FromJust(); - std::string path = TOSTR(info[0]); - found = mapnik::freetype_engine::register_fonts(path,recurse); - } -@@ -74,7 +74,7 @@ static inline NAN_METHOD(available_font_faces) - v8::Local a = Nan::New(names.size()); - for (unsigned i = 0; i < names.size(); ++i) - { -- a->Set(i, Nan::New(names[i].c_str()).ToLocalChecked()); -+ Nan::Set(a, i, Nan::New(names[i].c_str()).ToLocalChecked()); - } - info.GetReturnValue().Set(a); - } -@@ -86,7 +86,7 @@ static inline NAN_METHOD(memory_fonts) - unsigned i = 0; - for (auto const& kv : font_cache) - { -- a->Set(i++, Nan::New(kv.first.c_str()).ToLocalChecked()); -+ Nan::Set(a, i++, Nan::New(kv.first.c_str()).ToLocalChecked()); - } - info.GetReturnValue().Set(a); - } -@@ -97,7 +97,7 @@ static inline NAN_METHOD(available_font_files) - v8::Local obj = Nan::New(); - for (auto const& kv : mapping) - { -- obj->Set(Nan::New(kv.first.c_str()).ToLocalChecked(), Nan::New(kv.second.second.c_str()).ToLocalChecked()); -+ Nan::Set(obj, Nan::New(kv.first.c_str()).ToLocalChecked(), Nan::New(kv.second.second.c_str()).ToLocalChecked()); - } - info.GetReturnValue().Set(obj); - } -diff --git a/src/mapnik_geometry.cpp b/src/mapnik_geometry.cpp -index 1512c21e..02135b38 100644 ---- a/src/mapnik_geometry.cpp -+++ b/src/mapnik_geometry.cpp -@@ -37,23 +37,23 @@ void Geometry::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "toWKT", toWKT); - Nan::SetPrototypeMethod(lcons, "toJSON", toJSON); - Nan::SetPrototypeMethod(lcons, "toJSONSync", toJSONSync); -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "Unknown",mapnik::geometry::geometry_types::Unknown) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "Point",mapnik::geometry::geometry_types::Point) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "MultiPoint",mapnik::geometry::geometry_types::MultiPoint) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "LineString",mapnik::geometry::geometry_types::LineString) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "MultiLineString",mapnik::geometry::geometry_types::MultiLineString) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "Polygon",mapnik::geometry::geometry_types::Polygon) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "MultiPolygon",mapnik::geometry::geometry_types::MultiPolygon) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "GeometryCollection",mapnik::geometry::geometry_types::GeometryCollection) -- target->Set(Nan::New("Geometry").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Geometry").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -88,7 +88,7 @@ v8::Local Geometry::NewInstance(mapnik::feature_ptr f) { - Nan::EscapableHandleScope scope; - Geometry* g = new Geometry(f); - v8::Local ext = Nan::New(g); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Geometry instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -154,16 +154,16 @@ v8::Local Geometry::_toJSONSync(Nan::NAN_METHOD_ARGS_TYPE info) { - Nan::ThrowTypeError("optional first arg must be an options object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local options = info[0]->ToObject(); -- if (options->Has(Nan::New("transform").ToLocalChecked())) -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("transform").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bound_opt = options->Get(Nan::New("transform").ToLocalChecked()); -+ v8::Local bound_opt = Nan::Get(options, Nan::New("transform").ToLocalChecked()).ToLocalChecked(); - if (!bound_opt->IsObject()) { - Nan::ThrowTypeError("'transform' must be an object"); - return scope.Escape(Nan::Undefined()); - } - -- v8::Local obj = bound_opt->ToObject(); -+ v8::Local obj = bound_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(ProjTransform::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.ProjTransform expected as first arg"); - return scope.Escape(Nan::Undefined()); -@@ -224,16 +224,16 @@ NAN_METHOD(Geometry::toJSON) - Nan::ThrowTypeError("optional first arg must be an options object"); - return; - } -- v8::Local options = info[0]->ToObject(); -- if (options->Has(Nan::New("transform").ToLocalChecked())) -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("transform").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bound_opt = options->Get(Nan::New("transform").ToLocalChecked()); -+ v8::Local bound_opt = Nan::Get(options, Nan::New("transform").ToLocalChecked()).ToLocalChecked(); - if (!bound_opt->IsObject()) { - Nan::ThrowTypeError("'transform' must be an object"); - return; - } - -- v8::Local obj = bound_opt->ToObject(); -+ v8::Local obj = bound_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(ProjTransform::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.ProjTransform expected as first arg"); - return; -@@ -296,19 +296,20 @@ void Geometry::after_to_json(uv_work_t* req) - { - Nan::HandleScope scope; - to_json_baton *closure = static_cast(req->data); -+ Nan::AsyncResource async_resource(__func__); - if (closure->error) - { - // Fairly certain this situation can never be reached but - // leaving it none the less - /* LCOV_EXCL_START */ - v8::Local argv[1] = { Nan::Error(closure->result.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::New(closure->result).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->g->Unref(); - if (closure->tr) { -@@ -331,10 +332,10 @@ NAN_METHOD(Geometry::extent) - Geometry* g = Nan::ObjectWrap::Unwrap(info.Holder()); - v8::Local a = Nan::New(4); - mapnik::box2d const& e = g->feat_->envelope(); -- a->Set(0, Nan::New(e.minx())); -- a->Set(1, Nan::New(e.miny())); -- a->Set(2, Nan::New(e.maxx())); -- a->Set(3, Nan::New(e.maxy())); -+ Nan::Set(a, 0, Nan::New(e.minx())); -+ Nan::Set(a, 1, Nan::New(e.miny())); -+ Nan::Set(a, 2, Nan::New(e.maxx())); -+ Nan::Set(a, 3, Nan::New(e.maxy())); - info.GetReturnValue().Set(a); - } - -diff --git a/src/mapnik_grid.cpp b/src/mapnik_grid.cpp -index e2490b5f..b122c85d 100644 ---- a/src/mapnik_grid.cpp -+++ b/src/mapnik_grid.cpp -@@ -48,8 +48,8 @@ void Grid::Initialize(v8::Local target) { - // properties - ATTR(lcons, "key", get_key, set_key); - -- target->Set(Nan::New("Grid").ToLocalChecked(), lcons->GetFunction()); -- NODE_MAPNIK_DEFINE_64_BIT_CONSTANT(lcons->GetFunction(), "base_mask", mapnik::grid::base_mask); -+ Nan::Set(target, Nan::New("Grid").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); -+ NODE_MAPNIK_DEFINE_64_BIT_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), "base_mask", mapnik::grid::base_mask); - - constructor.Reset(lcons); - } -@@ -92,8 +92,8 @@ NAN_METHOD(Grid::New) - } - v8::Local options = info[2].As(); - -- if (options->Has(Nan::New("key").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("key").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("key").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("key").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsString()) - { - Nan::ThrowTypeError("optional arg 'key' must be an string"); -@@ -104,7 +104,7 @@ NAN_METHOD(Grid::New) - } - } - -- Grid* g = new Grid(info[0]->IntegerValue(), info[1]->IntegerValue(), key); -+ Grid* g = new Grid(Nan::To(info[0]).FromJust(), Nan::To(info[1]).FromJust(), key); - g->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - return; -@@ -183,6 +183,7 @@ void Grid::EIO_Clear(uv_work_t* req) - void Grid::EIO_AfterClear(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - clear_grid_baton_t *closure = static_cast(req->data); - if (closure->error) - { -@@ -191,13 +192,13 @@ void Grid::EIO_AfterClear(uv_work_t* req) - // coverage - /* LCOV_EXCL_START */ - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->g->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->g->Unref(); - closure->cb.Reset(); -@@ -299,7 +300,7 @@ NAN_METHOD(Grid::fields) - for (; itr != end; ++itr) - { - std::string name = *itr; -- l->Set(idx, Nan::New(name).ToLocalChecked()); -+ Nan::Set(l, idx, Nan::New(name).ToLocalChecked()); - ++idx; - } - info.GetReturnValue().Set(l); -@@ -324,10 +325,10 @@ NAN_METHOD(Grid::view) - return; - } - -- unsigned x = info[0]->IntegerValue(); -- unsigned y = info[1]->IntegerValue(); -- unsigned w = info[2]->IntegerValue(); -- unsigned h = info[3]->IntegerValue(); -+ unsigned x = Nan::To(info[0]).FromJust(); -+ unsigned y = Nan::To(info[1]).FromJust(); -+ unsigned w = Nan::To(info[2]).FromJust(); -+ unsigned h = Nan::To(info[3]).FromJust(); - - Grid* g = Nan::ObjectWrap::Unwrap(info.Holder()); - info.GetReturnValue().Set(GridView::NewInstance(g,x,y,w,h)); -@@ -359,16 +360,16 @@ NAN_METHOD(Grid::encodeSync) - - v8::Local options = info[0].As(); - -- if (options->Has(Nan::New("resolution").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("resolution").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("resolution").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("resolution").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("'resolution' must be an Integer"); - return; - } - -- resolution = bind_opt->IntegerValue(); -+ resolution = Nan::To(bind_opt).FromJust(); - if (resolution == 0) - { - Nan::ThrowTypeError("'resolution' can not be zero"); -@@ -376,16 +377,16 @@ NAN_METHOD(Grid::encodeSync) - } - } - -- if (options->Has(Nan::New("features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("features").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("features").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) - { - Nan::ThrowTypeError("'features' must be an Boolean"); - return; - } - -- add_features = bind_opt->BooleanValue(); -+ add_features = Nan::To(bind_opt).FromJust(); - } - } - -@@ -401,7 +402,7 @@ NAN_METHOD(Grid::encodeSync) - unsigned int i; - for (it = key_order.begin(), i = 0; it < key_order.end(); ++it, ++i) - { -- keys_a->Set(i, Nan::New(*it).ToLocalChecked()); -+ Nan::Set(keys_a, i, Nan::New(*it).ToLocalChecked()); - } - - mapnik::grid const& grid_type = *g->get(); -@@ -421,11 +422,11 @@ NAN_METHOD(Grid::encodeSync) - for (unsigned j=0;jSet(j, Nan::New(line.get(),array_size).ToLocalChecked()); -+ Nan::Set(grid_array, j, Nan::New(line.get(),array_size).ToLocalChecked()); - } -- json->Set(Nan::New("grid").ToLocalChecked(), grid_array); -- json->Set(Nan::New("keys").ToLocalChecked(), keys_a); -- json->Set(Nan::New("data").ToLocalChecked(), feature_data); -+ Nan::Set(json, Nan::New("grid").ToLocalChecked(), grid_array); -+ Nan::Set(json, Nan::New("keys").ToLocalChecked(), keys_a); -+ Nan::Set(json, Nan::New("data").ToLocalChecked(), feature_data); - info.GetReturnValue().Set(json); - - } -@@ -470,16 +471,16 @@ NAN_METHOD(Grid::encode) - - v8::Local options = info[0].As(); - -- if (options->Has(Nan::New("resolution").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("resolution").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("resolution").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("resolution").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("'resolution' must be an Integer"); - return; - } - -- resolution = bind_opt->IntegerValue(); -+ resolution = Nan::To(bind_opt).FromJust(); - if (resolution == 0) - { - Nan::ThrowTypeError("'resolution' can not be zero"); -@@ -487,16 +488,16 @@ NAN_METHOD(Grid::encode) - } - } - -- if (options->Has(Nan::New("features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("features").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("features").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) - { - Nan::ThrowTypeError("'features' must be an Boolean"); - return; - } - -- add_features = bind_opt->BooleanValue(); -+ add_features = Nan::To(bind_opt).FromJust(); - } - } - -@@ -546,7 +547,7 @@ void Grid::EIO_Encode(uv_work_t* req) - void Grid::EIO_AfterEncode(uv_work_t* req) - { - Nan::HandleScope scope; -- -+ Nan::AsyncResource async_resource(__func__); - encode_grid_baton_t *closure = static_cast(req->data); - - -@@ -556,7 +557,7 @@ void Grid::EIO_AfterEncode(uv_work_t* req) - // so simply removing the following from coverage - /* LCOV_EXCL_START */ - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } - else -@@ -568,7 +569,7 @@ void Grid::EIO_AfterEncode(uv_work_t* req) - unsigned int i; - for (it = closure->key_order.begin(), i = 0; it < closure->key_order.end(); ++it, ++i) - { -- keys_a->Set(i, Nan::New(*it).ToLocalChecked()); -+ Nan::Set(keys_a, i, Nan::New(*it).ToLocalChecked()); - } - - mapnik::grid const& grid_type = *closure->g->get(); -@@ -587,14 +588,14 @@ void Grid::EIO_AfterEncode(uv_work_t* req) - for (unsigned j=0;jlines.size();++j) - { - node_mapnik::grid_line_type const & line = closure->lines[j]; -- grid_array->Set(j, Nan::New(line.get(),array_size).ToLocalChecked()); -+ Nan::Set(grid_array, j, Nan::New(line.get(),array_size).ToLocalChecked()); - } -- json->Set(Nan::New("grid").ToLocalChecked(), grid_array); -- json->Set(Nan::New("keys").ToLocalChecked(), keys_a); -- json->Set(Nan::New("data").ToLocalChecked(), feature_data); -+ Nan::Set(json, Nan::New("grid").ToLocalChecked(), grid_array); -+ Nan::Set(json, Nan::New("keys").ToLocalChecked(), keys_a); -+ Nan::Set(json, Nan::New("data").ToLocalChecked(), feature_data); - - v8::Local argv[2] = { Nan::Null(), json }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->g->Unref(); -diff --git a/src/mapnik_grid_view.cpp b/src/mapnik_grid_view.cpp -index 3d66882f..24dcfe50 100644 ---- a/src/mapnik_grid_view.cpp -+++ b/src/mapnik_grid_view.cpp -@@ -31,7 +31,7 @@ void GridView::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "isSolidSync", isSolidSync); - Nan::SetPrototypeMethod(lcons, "getPixel", getPixel); - -- target->Set(Nan::New("GridView").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("GridView").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -83,7 +83,7 @@ v8::Local GridView::NewInstance(Grid * JSGrid, - GridView* gv = new GridView(JSGrid); - gv->this_ = std::make_shared(JSGrid->get()->get_view(x,y,w,h)); - v8::Local ext = Nan::New(gv); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new GridView instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -111,7 +111,7 @@ NAN_METHOD(GridView::fields) - for (; itr != end; ++itr) - { - std::string name = *itr; -- l->Set(idx, Nan::New(name).ToLocalChecked()); -+ Nan::Set(l, idx, Nan::New(name).ToLocalChecked()); - ++idx; - } - info.GetReturnValue().Set(l); -@@ -186,10 +186,11 @@ void GridView::EIO_IsSolid(uv_work_t* req) - void GridView::EIO_AfterIsSolid(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - is_solid_grid_view_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { -@@ -199,14 +200,14 @@ void GridView::EIO_AfterIsSolid(uv_work_t* req) - Nan::New(closure->result), - Nan::New(closure->pixel), - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), - Nan::New(closure->result) - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - closure->g->Unref(); -@@ -258,8 +259,8 @@ NAN_METHOD(GridView::getPixel) - Nan::ThrowTypeError("second arg, 'y' must be an integer"); - return; - } -- x = info[0]->IntegerValue(); -- y = info[1]->IntegerValue(); -+ x = Nan::To(info[0]).FromJust(); -+ y = Nan::To(info[1]).FromJust(); - } else { - Nan::ThrowTypeError("must supply x,y to query pixel color"); - return; -@@ -293,16 +294,16 @@ NAN_METHOD(GridView::encodeSync) - - v8::Local options = info[0].As(); - -- if (options->Has(Nan::New("resolution").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("resolution").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("resolution").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("resolution").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("'resolution' must be an Integer"); - return; - } - -- resolution = bind_opt->IntegerValue(); -+ resolution = Nan::To(bind_opt).FromJust(); - - if (resolution == 0) - { -@@ -311,16 +312,16 @@ NAN_METHOD(GridView::encodeSync) - } - } - -- if (options->Has(Nan::New("features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("features").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("features").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) - { - Nan::ThrowTypeError("'features' must be an Boolean"); - return; - } - -- add_features = bind_opt->BooleanValue(); -+ add_features = Nan::To(bind_opt).FromJust(); - } - } - -@@ -336,7 +337,7 @@ NAN_METHOD(GridView::encodeSync) - unsigned int i; - for (it = key_order.begin(), i = 0; it != key_order.end(); ++it, ++i) - { -- keys_a->Set(i, Nan::New(*it).ToLocalChecked()); -+ Nan::Set(keys_a, i, Nan::New(*it).ToLocalChecked()); - } - - mapnik::grid_view const& grid_type = *g->get(); -@@ -356,11 +357,11 @@ NAN_METHOD(GridView::encodeSync) - for (unsigned j=0;jSet(j, Nan::New(line.get(),array_size).ToLocalChecked()); -+ Nan::Set(grid_array, j, Nan::New(line.get(),array_size).ToLocalChecked()); - } -- json->Set(Nan::New("grid").ToLocalChecked(), grid_array); -- json->Set(Nan::New("keys").ToLocalChecked(), keys_a); -- json->Set(Nan::New("data").ToLocalChecked(), feature_data); -+ Nan::Set(json, Nan::New("grid").ToLocalChecked(), grid_array); -+ Nan::Set(json, Nan::New("keys").ToLocalChecked(), keys_a); -+ Nan::Set(json, Nan::New("data").ToLocalChecked(), feature_data); - info.GetReturnValue().Set(json); - - } -@@ -407,16 +408,16 @@ NAN_METHOD(GridView::encode) - - v8::Local options = info[0].As(); - -- if (options->Has(Nan::New("resolution").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("resolution").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("resolution").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("resolution").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("'resolution' must be an Integer"); - return; - } - -- resolution = bind_opt->IntegerValue(); -+ resolution = Nan::To(bind_opt).FromJust(); - - if (resolution == 0) - { -@@ -425,16 +426,16 @@ NAN_METHOD(GridView::encode) - } - } - -- if (options->Has(Nan::New("features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("features").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("features").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) - { - Nan::ThrowTypeError("'features' must be an Boolean"); - return; - } - -- add_features = bind_opt->BooleanValue(); -+ add_features = Nan::To(bind_opt).FromJust(); - } - } - -@@ -484,6 +485,7 @@ void GridView::EIO_Encode(uv_work_t* req) - void GridView::EIO_AfterEncode(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - - encode_grid_view_baton_t *closure = static_cast(req->data); - -@@ -492,7 +494,7 @@ void GridView::EIO_AfterEncode(uv_work_t* req) - // so simply removing the following from coverage - /* LCOV_EXCL_START */ - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } - else -@@ -503,7 +505,7 @@ void GridView::EIO_AfterEncode(uv_work_t* req) - unsigned int i; - for (it = closure->key_order.begin(), i = 0; it != closure->key_order.end(); ++it, ++i) - { -- keys_a->Set(i, Nan::New(*it).ToLocalChecked()); -+ Nan::Set(keys_a, i, Nan::New(*it).ToLocalChecked()); - } - - mapnik::grid_view const& grid_type = *(closure->g->get()); -@@ -522,14 +524,14 @@ void GridView::EIO_AfterEncode(uv_work_t* req) - for (unsigned j=0;jlines.size();++j) - { - node_mapnik::grid_line_type const & line = closure->lines[j]; -- grid_array->Set(j, Nan::New(line.get(),array_size).ToLocalChecked()); -+ Nan::Set(grid_array, j, Nan::New(line.get(),array_size).ToLocalChecked()); - } -- json->Set(Nan::New("grid").ToLocalChecked(), grid_array); -- json->Set(Nan::New("keys").ToLocalChecked(), keys_a); -- json->Set(Nan::New("data").ToLocalChecked(), feature_data); -+ Nan::Set(json, Nan::New("grid").ToLocalChecked(), grid_array); -+ Nan::Set(json, Nan::New("keys").ToLocalChecked(), keys_a); -+ Nan::Set(json, Nan::New("data").ToLocalChecked(), feature_data); - - v8::Local argv[2] = { Nan::Null(), json }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->g->Unref(); -diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp -index 5f0313d0..477650fc 100644 ---- a/src/mapnik_image.cpp -+++ b/src/mapnik_image.cpp -@@ -115,34 +115,34 @@ void Image::Initialize(v8::Local target) { - ATTR(lcons, "offset", get_offset, set_offset); - - // This *must* go after the ATTR setting -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "open", - Image::open); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromBytes", - Image::fromBytes); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "openSync", - Image::openSync); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromBytesSync", - Image::fromBytesSync); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromBufferSync", - Image::fromBufferSync); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromSVG", - Image::fromSVG); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromSVGSync", - Image::fromSVGSync); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromSVGBytes", - Image::fromSVGBytes); -- Nan::SetMethod(lcons->GetFunction().As(), -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), - "fromSVGBytesSync", - Image::fromSVGBytesSync); -- target->Set(Nan::New("Image").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Image").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -196,19 +196,19 @@ NAN_METHOD(Image::New) - if (info[2]->IsObject()) - { - v8::Local options = v8::Local::Cast(info[2]); -- if (options->Has(Nan::New("type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("type").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local init_val = options->Get(Nan::New("type").ToLocalChecked()); -+ v8::Local init_val = Nan::Get(options, Nan::New("type").ToLocalChecked()).ToLocalChecked(); - - if (!init_val.IsEmpty() && init_val->IsNumber()) - { -- int int_val = init_val->IntegerValue(); -+ int int_val = Nan::To(init_val).FromJust(); - if (int_val >= mapnik::image_dtype::IMAGE_DTYPE_MAX || int_val < 0) - { - Nan::ThrowTypeError("Image 'type' must be a valid image type"); - return; - } -- type = static_cast(init_val->IntegerValue()); -+ type = static_cast(Nan::To(init_val).FromJust()); - } - else - { -@@ -217,12 +217,12 @@ NAN_METHOD(Image::New) - } - } - -- if (options->Has(Nan::New("initialize").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("initialize").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local init_val = options->Get(Nan::New("initialize").ToLocalChecked()); -+ v8::Local init_val = Nan::Get(options, Nan::New("initialize").ToLocalChecked()).ToLocalChecked(); - if (!init_val.IsEmpty() && init_val->IsBoolean()) - { -- initialize = init_val->BooleanValue(); -+ initialize = Nan::To(init_val).FromJust(); - } - else - { -@@ -231,12 +231,12 @@ NAN_METHOD(Image::New) - } - } - -- if (options->Has(Nan::New("premultiplied").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("premultiplied").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local pre_val = options->Get(Nan::New("premultiplied").ToLocalChecked()); -+ v8::Local pre_val = Nan::Get(options, Nan::New("premultiplied").ToLocalChecked()).ToLocalChecked(); - if (!pre_val.IsEmpty() && pre_val->IsBoolean()) - { -- premultiplied = pre_val->BooleanValue(); -+ premultiplied = Nan::To(pre_val).FromJust(); - } - else - { -@@ -245,12 +245,12 @@ NAN_METHOD(Image::New) - } - } - -- if (options->Has(Nan::New("painted").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("painted").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local painted_val = options->Get(Nan::New("painted").ToLocalChecked()); -+ v8::Local painted_val = Nan::Get(options, Nan::New("painted").ToLocalChecked()).ToLocalChecked(); - if (!painted_val.IsEmpty() && painted_val->IsBoolean()) - { -- painted = painted_val->BooleanValue(); -+ painted = Nan::To(painted_val).FromJust(); - } - else - { -@@ -267,8 +267,8 @@ NAN_METHOD(Image::New) - } - - try { -- Image* im = new Image(info[0]->IntegerValue(), -- info[1]->IntegerValue(), -+ Image* im = new Image(Nan::To(info[0]).FromJust(), -+ Nan::To(info[1]).FromJust(), - type, - initialize, - premultiplied, -@@ -445,15 +445,15 @@ NAN_METHOD(Image::getPixel) - return; - } - -- v8::Local options = info[2]->ToObject(); -+ v8::Local options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("get_color").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("get_color").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("get_color").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("get_color").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) { - Nan::ThrowTypeError("optional arg 'color' must be a boolean"); - return; - } -- get_color = bind_opt->BooleanValue(); -+ get_color = Nan::To(bind_opt).FromJust(); - } - - } -@@ -467,8 +467,8 @@ NAN_METHOD(Image::getPixel) - Nan::ThrowTypeError("second arg, 'y' must be an integer"); - return; - } -- x = info[0]->IntegerValue(); -- y = info[1]->IntegerValue(); -+ x = Nan::To(info[0]).FromJust(); -+ y = Nan::To(info[1]).FromJust(); - } else { - Nan::ThrowError("must supply x,y to query pixel color"); - return; -@@ -509,8 +509,8 @@ NAN_METHOD(Image::setPixel) - Nan::ThrowTypeError("expects three arguments: x, y, and pixel value"); - return; - } -- int x = info[0]->IntegerValue(); -- int y = info[1]->IntegerValue(); -+ int x = Nan::To(info[0]).FromJust(); -+ int y = Nan::To(info[1]).FromJust(); - Image* im = Nan::ObjectWrap::Unwrap(info.Holder()); - if (x < 0 || x >= static_cast(im->this_->width()) || y < 0 || y >= static_cast(im->this_->height())) - { -@@ -519,22 +519,22 @@ NAN_METHOD(Image::setPixel) - } - if (info[2]->IsUint32()) - { -- std::uint32_t val = info[2]->Uint32Value(); -+ std::uint32_t val = Nan::To(info[2]).FromJust(); - mapnik::set_pixel(*im->this_,x,y,val); - } - else if (info[2]->IsInt32()) - { -- std::int32_t val = info[2]->Int32Value(); -+ std::int32_t val = Nan::To(info[2]).FromJust(); - mapnik::set_pixel(*im->this_,x,y,val); - } - else if (info[2]->IsNumber()) - { -- double val = info[2]->NumberValue(); -+ double val = Nan::To(info[2]).FromJust(); - mapnik::set_pixel(*im->this_,x,y,val); - } - else if (info[2]->IsObject()) - { -- v8::Local obj = info[2]->ToObject(); -+ v8::Local obj = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Color::constructor)->HasInstance(obj)) - { - Nan::ThrowTypeError("A numeric or color value is expected as third arg"); -@@ -599,7 +599,7 @@ NAN_METHOD(Image::compare) - Nan::ThrowTypeError("first argument should be a mapnik.Image"); - return; - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Image::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Image expected as first arg"); - return; -@@ -615,24 +615,24 @@ NAN_METHOD(Image::compare) - return; - } - -- v8::Local options = info[1]->ToObject(); -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("threshold").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("threshold").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("threshold").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("threshold").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'threshold' must be a number"); - return; - } -- threshold = bind_opt->IntegerValue(); -+ threshold = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("alpha").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("alpha").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("alpha").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("alpha").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) { - Nan::ThrowTypeError("optional arg 'alpha' must be a boolean"); - return; - } -- alpha = bind_opt->BooleanValue(); -+ alpha = Nan::To(bind_opt).FromJust(); - } - - } -@@ -764,16 +764,17 @@ void Image::EIO_Filter(uv_work_t* req) - void Image::EIO_AfterFilter(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - filter_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->im->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->im->Unref(); - closure->cb.Reset(); -@@ -812,22 +813,22 @@ v8::Local Image::_fillSync(Nan::NAN_METHOD_ARGS_TYPE info) { - { - if (info[0]->IsUint32()) - { -- std::uint32_t val = info[0]->Uint32Value(); -+ std::uint32_t val = Nan::To(info[0]).FromJust(); - mapnik::fill(*im->this_,val); - } - else if (info[0]->IsInt32()) - { -- std::int32_t val = info[0]->Int32Value(); -+ std::int32_t val = Nan::To(info[0]).FromJust(); - mapnik::fill(*im->this_,val); - } - else if (info[0]->IsNumber()) - { -- double val = info[0]->NumberValue(); -+ double val = Nan::To(info[0]).FromJust(); - mapnik::fill(*im->this_,val); - } - else if (info[0]->IsObject()) - { -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Color::constructor)->HasInstance(obj)) - { - Nan::ThrowTypeError("A numeric or color value is expected"); -@@ -903,22 +904,22 @@ NAN_METHOD(Image::fill) - fill_image_baton_t *closure = new fill_image_baton_t(); - if (info[0]->IsUint32()) - { -- closure->val_u32 = info[0]->Uint32Value(); -+ closure->val_u32 = Nan::To(info[0]).FromJust(); - closure->type = FILL_UINT32; - } - else if (info[0]->IsInt32()) - { -- closure->val_32 = info[0]->Int32Value(); -+ closure->val_32 = Nan::To(info[0]).FromJust(); - closure->type = FILL_INT32; - } - else if (info[0]->IsNumber()) - { -- closure->val_double = info[0]->NumberValue(); -+ closure->val_double = Nan::To(info[0]).FromJust(); - closure->type = FILL_DOUBLE; - } - else if (info[0]->IsObject()) - { -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Color::constructor)->HasInstance(obj)) - { - delete closure; -@@ -988,16 +989,17 @@ void Image::EIO_Fill(uv_work_t* req) - void Image::EIO_AfterFill(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - fill_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->im->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->im->Unref(); - closure->cb.Reset(); -@@ -1101,16 +1103,17 @@ void Image::EIO_Clear(uv_work_t* req) - void Image::EIO_AfterClear(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - clear_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->im->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->im->Unref(); - closure->cb.Reset(); -@@ -1145,7 +1148,7 @@ NAN_METHOD(Image::setGrayScaleToAlpha) - return; - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Color::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Color expected as first arg"); -@@ -1256,9 +1259,10 @@ void Image::EIO_Premultiply(uv_work_t* req) - void Image::EIO_AfterMultiply(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - image_op_baton_t *closure = static_cast(req->data); - v8::Local argv[2] = { Nan::Null(), closure->im->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - closure->im->Unref(); - closure->cb.Reset(); - delete closure; -@@ -1390,10 +1394,11 @@ void Image::EIO_IsSolid(uv_work_t* req) - void Image::EIO_AfterIsSolid(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - is_solid_image_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { -@@ -1403,12 +1408,12 @@ void Image::EIO_AfterIsSolid(uv_work_t* req) - Nan::New(closure->result), - mapnik::util::apply_visitor(visitor_get_pixel(0,0),*(closure->im->this_)), - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::New(closure->result) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - closure->im->Unref(); -@@ -1495,7 +1500,7 @@ NAN_METHOD(Image::copy) - { - if (info[0]->IsNumber()) - { -- type = static_cast(info[0]->IntegerValue()); -+ type = static_cast(Nan::To(info[0]).FromJust()); - if (type >= mapnik::image_dtype::IMAGE_DTYPE_MAX) - { - Nan::ThrowTypeError("Image 'type' must be a valid image type"); -@@ -1504,7 +1509,7 @@ NAN_METHOD(Image::copy) - } - else if (info[0]->IsObject()) - { -- options = info[0]->ToObject(); -+ options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -1516,7 +1521,7 @@ NAN_METHOD(Image::copy) - { - if (info[1]->IsObject()) - { -- options = info[1]->ToObject(); -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -1525,12 +1530,12 @@ NAN_METHOD(Image::copy) - } - } - -- if (options->Has(Nan::New("scaling").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scaling_val = options->Get(Nan::New("scaling").ToLocalChecked()); -+ v8::Local scaling_val = Nan::Get(options, Nan::New("scaling").ToLocalChecked()).ToLocalChecked(); - if (scaling_val->IsNumber()) - { -- scaling = scaling_val->NumberValue(); -+ scaling = Nan::To(scaling_val).FromJust(); - scaling_or_offset_set = true; - } - else -@@ -1540,12 +1545,12 @@ NAN_METHOD(Image::copy) - } - } - -- if (options->Has(Nan::New("offset").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local offset_val = options->Get(Nan::New("offset").ToLocalChecked()); -+ v8::Local offset_val = Nan::Get(options, Nan::New("offset").ToLocalChecked()).ToLocalChecked(); - if (offset_val->IsNumber()) - { -- offset = offset_val->NumberValue(); -+ offset = Nan::To(offset_val).FromJust(); - scaling_or_offset_set = true; - } - else -@@ -1596,11 +1601,12 @@ void Image::EIO_Copy(uv_work_t* req) - void Image::EIO_AfterCopy(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - copy_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else if (!closure->im2) - { -@@ -1608,17 +1614,17 @@ void Image::EIO_AfterCopy(uv_work_t* req) - // and simply removing it from coverage tests. - /* LCOV_EXCL_START */ - v8::Local argv[1] = { Nan::Error("could not render to image") }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } - else - { - Image* im = new Image(closure->im2); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->im1->Unref(); - closure->cb.Reset(); -@@ -1658,7 +1664,7 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - { - if (info[0]->IsNumber()) - { -- type = static_cast(info[0]->IntegerValue()); -+ type = static_cast(Nan::To(info[0]).FromJust()); - if (type >= mapnik::image_dtype::IMAGE_DTYPE_MAX) - { - Nan::ThrowTypeError("Image 'type' must be a valid image type"); -@@ -1667,7 +1673,7 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - } - else if (info[0]->IsObject()) - { -- options = info[0]->ToObject(); -+ options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -1679,7 +1685,7 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - { - if (info[1]->IsObject()) - { -- options = info[1]->ToObject(); -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -1688,12 +1694,12 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - } - } - -- if (options->Has(Nan::New("scaling").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scaling_val = options->Get(Nan::New("scaling").ToLocalChecked()); -+ v8::Local scaling_val = Nan::Get(options, Nan::New("scaling").ToLocalChecked()).ToLocalChecked(); - if (scaling_val->IsNumber()) - { -- scaling = scaling_val->NumberValue(); -+ scaling = Nan::To(scaling_val).FromJust(); - scaling_or_offset_set = true; - } - else -@@ -1703,12 +1709,12 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - } - } - -- if (options->Has(Nan::New("offset").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local offset_val = options->Get(Nan::New("offset").ToLocalChecked()); -+ v8::Local offset_val = Nan::Get(options, Nan::New("offset").ToLocalChecked()).ToLocalChecked(); - if (offset_val->IsNumber()) - { -- offset = offset_val->NumberValue(); -+ offset = Nan::To(offset_val).FromJust(); - scaling_or_offset_set = true; - } - else -@@ -1734,7 +1740,7 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) - ); - Image* new_im = new Image(imagep); - v8::Local ext = Nan::New(new_im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -1802,7 +1808,7 @@ NAN_METHOD(Image::resize) - { - if (info[0]->IsNumber()) - { -- auto width_tmp = info[0]->IntegerValue(); -+ auto width_tmp = Nan::To(info[0]).FromJust(); - if (width_tmp <= 0) - { - Nan::ThrowTypeError("Width must be a integer greater then zero"); -@@ -1817,7 +1823,7 @@ NAN_METHOD(Image::resize) - } - if (info[1]->IsNumber()) - { -- auto height_tmp = info[1]->IntegerValue(); -+ auto height_tmp = Nan::To(info[1]).FromJust(); - if (height_tmp <= 0) - { - Nan::ThrowTypeError("Height must be a integer greater then zero"); -@@ -1840,7 +1846,7 @@ NAN_METHOD(Image::resize) - { - if (info[2]->IsObject()) - { -- options = info[2]->ToObject(); -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -1848,32 +1854,32 @@ NAN_METHOD(Image::resize) - return; - } - } -- if (options->Has(Nan::New("offset_x").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_x").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_x").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_x' must be a number"); - return; - } -- offset_x = bind_opt->IntegerValue(); -+ offset_x = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("offset_y").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_y").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_y").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_y' must be a number"); - return; - } -- offset_y = bind_opt->IntegerValue(); -+ offset_y = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("scaling_method").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scaling_method").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scaling_val = options->Get(Nan::New("scaling_method").ToLocalChecked()); -+ v8::Local scaling_val = Nan::Get(options, Nan::New("scaling_method").ToLocalChecked()).ToLocalChecked(); - if (scaling_val->IsNumber()) - { -- std::int64_t scaling_int = scaling_val->IntegerValue(); -+ std::int64_t scaling_int = Nan::To(scaling_val).FromJust(); - if (scaling_int > mapnik::SCALING_BLACKMAN || scaling_int < 0) - { - Nan::ThrowTypeError("Invalid scaling_method"); -@@ -1888,12 +1894,12 @@ NAN_METHOD(Image::resize) - } - } - -- if (options->Has(Nan::New("filter_factor").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("filter_factor").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local ff_val = options->Get(Nan::New("filter_factor").ToLocalChecked()); -+ v8::Local ff_val = Nan::Get(options, Nan::New("filter_factor").ToLocalChecked()).ToLocalChecked(); - if (ff_val->IsNumber()) - { -- filter_factor = ff_val->NumberValue(); -+ filter_factor = Nan::To(ff_val).FromJust(); - } - else - { -@@ -2070,20 +2076,21 @@ void Image::EIO_Resize(uv_work_t* req) - void Image::EIO_AfterResize(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - resize_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - Image* im = new Image(closure->im2); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->im1->Unref(); - closure->cb.Reset(); -@@ -2129,7 +2136,7 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - { - if (info[0]->IsNumber()) - { -- int width_tmp = info[0]->IntegerValue(); -+ int width_tmp = Nan::To(info[0]).FromJust(); - if (width_tmp <= 0) - { - Nan::ThrowTypeError("Width parameter must be an integer greater then zero"); -@@ -2144,7 +2151,7 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - } - if (info[1]->IsNumber()) - { -- int height_tmp = info[1]->IntegerValue(); -+ int height_tmp = Nan::To(info[1]).FromJust(); - if (height_tmp <= 0) - { - Nan::ThrowTypeError("Height parameter must be an integer greater then zero"); -@@ -2167,7 +2174,7 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - { - if (info[2]->IsObject()) - { -- options = info[2]->ToObject(); -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - } - else - { -@@ -2175,33 +2182,33 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("offset_x").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_x").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_x").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_x' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- offset_x = bind_opt->IntegerValue(); -+ offset_x = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("offset_y").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_y").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_y").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_y' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- offset_y = bind_opt->IntegerValue(); -+ offset_y = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("scaling_method").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scaling_method").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scaling_val = options->Get(Nan::New("scaling_method").ToLocalChecked()); -+ v8::Local scaling_val = Nan::Get(options, Nan::New("scaling_method").ToLocalChecked()).ToLocalChecked(); - if (scaling_val->IsNumber()) - { -- std::int64_t scaling_int = scaling_val->IntegerValue(); -+ std::int64_t scaling_int = Nan::To(scaling_val).FromJust(); - if (scaling_int > mapnik::SCALING_BLACKMAN || scaling_int < 0) - { - Nan::ThrowTypeError("Invalid scaling_method"); -@@ -2216,12 +2223,12 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - } - } - -- if (options->Has(Nan::New("filter_factor").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("filter_factor").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local ff_val = options->Get(Nan::New("filter_factor").ToLocalChecked()); -+ v8::Local ff_val = Nan::Get(options, Nan::New("filter_factor").ToLocalChecked()).ToLocalChecked(); - if (ff_val->IsNumber()) - { -- filter_factor = ff_val->NumberValue(); -+ filter_factor = Nan::To(ff_val).FromJust(); - } - else - { -@@ -2267,7 +2274,7 @@ v8::Local Image::_resizeSync(Nan::NAN_METHOD_ARGS_TYPE info) - mapnik::util::apply_visitor(visit, *imagep); - Image* new_im = new Image(imagep); - v8::Local ext = Nan::New(new_im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -2378,7 +2385,7 @@ v8::Local Image::_openSync(Nan::NAN_METHOD_ARGS_TYPE info) - } - Image* im = new Image(imagep); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -2506,20 +2513,21 @@ void Image::EIO_Open(uv_work_t* req) - void Image::EIO_AfterOpen(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - image_file_ptr_baton_t *closure = static_cast(req->data); - if (closure->error || !closure->im) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - Image* im = new Image(closure->im); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->cb.Reset(); - delete closure; -@@ -2596,46 +2604,46 @@ v8::Local Image::_fromSVGSync(bool fromFile, Nan::NAN_METHOD_ARGS_TYP - Nan::ThrowTypeError("optional second arg must be an options object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scale_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local scale_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!scale_opt->IsNumber()) - { - Nan::ThrowTypeError("'scale' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- scale = scale_opt->NumberValue(); -+ scale = Nan::To(scale_opt).FromJust(); - if (scale <= 0) - { - Nan::ThrowTypeError("'scale' must be a positive non zero number"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("max_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("max_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("max_size").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("'max_size' must be a positive integer"); - return scope.Escape(Nan::Undefined()); - } -- auto max_size_val = opt->IntegerValue(); -+ auto max_size_val = Nan::To(opt).FromJust(); - if (max_size_val < 0 || max_size_val > 65535) { - Nan::ThrowTypeError("'max_size' must be a positive integer between 0 and 65535"); - return scope.Escape(Nan::Undefined()); - } - max_size = static_cast(max_size_val); - } -- if (options->Has(Nan::New("strict").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strict").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("strict").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("strict").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsBoolean()) - { - Nan::ThrowTypeError("'strict' must be a boolean value"); - return scope.Escape(Nan::Undefined()); - } -- strict = opt->BooleanValue(); -+ strict = Nan::To(opt).FromJust(); - } - } - -@@ -2663,7 +2671,7 @@ v8::Local Image::_fromSVGSync(bool fromFile, Nan::NAN_METHOD_ARGS_TYP - } - else - { -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first argument is invalid, must be a Buffer"); -@@ -2738,7 +2746,7 @@ v8::Local Image::_fromSVGSync(bool fromFile, Nan::NAN_METHOD_ARGS_TYP - image_ptr imagep = std::make_shared(im); - Image *im2 = new Image(imagep); - v8::Local ext = Nan::New(im2); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -2830,46 +2838,46 @@ NAN_METHOD(Image::fromSVG) - Nan::ThrowTypeError("optional second arg must be an options object"); - return; - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scale_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local scale_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!scale_opt->IsNumber()) - { - Nan::ThrowTypeError("'scale' must be a number"); - return; - } -- scale = scale_opt->NumberValue(); -+ scale = Nan::To(scale_opt).FromJust(); - if (scale <= 0) - { - Nan::ThrowTypeError("'scale' must be a positive non zero number"); - return; - } - } -- if (options->Has(Nan::New("max_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("max_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("max_size").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("'max_size' must be a positive integer"); - return; - } -- auto max_size_val = opt->IntegerValue(); -+ auto max_size_val = Nan::To(opt).FromJust(); - if (max_size_val < 0 || max_size_val > 65535) { - Nan::ThrowTypeError("'max_size' must be a positive integer between 0 and 65535"); - return; - } - max_size = static_cast(max_size_val); - } -- if (options->Has(Nan::New("strict").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strict").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("strict").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("strict").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsBoolean()) - { - Nan::ThrowTypeError("'strict' must be a boolean value"); - return; - } -- strict = opt->BooleanValue(); -+ strict = Nan::To(opt).FromJust(); - } - } - -@@ -2981,20 +2989,21 @@ void Image::EIO_FromSVG(uv_work_t* req) - void Image::EIO_AfterFromSVG(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - svg_file_ptr_baton_t *closure = static_cast(req->data); - if (closure->error || !closure->im) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - Image* im = new Image(closure->im); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->cb.Reset(); - delete closure; -@@ -3033,7 +3042,7 @@ NAN_METHOD(Image::fromSVGBytes) - return; - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) { - Nan::ThrowTypeError("first argument is invalid, must be a Buffer"); - return; -@@ -3056,46 +3065,46 @@ NAN_METHOD(Image::fromSVGBytes) - Nan::ThrowTypeError("optional second arg must be an options object"); - return; - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local scale_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local scale_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!scale_opt->IsNumber()) - { - Nan::ThrowTypeError("'scale' must be a number"); - return; - } -- scale = scale_opt->NumberValue(); -+ scale = Nan::To(scale_opt).FromJust(); - if (scale <= 0) - { - Nan::ThrowTypeError("'scale' must be a positive non zero number"); - return; - } - } -- if (options->Has(Nan::New("max_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("max_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("max_size").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("'max_size' must be a positive integer"); - return; - } -- auto max_size_val = opt->IntegerValue(); -+ auto max_size_val = Nan::To(opt).FromJust(); - if (max_size_val < 0 || max_size_val > 65535) { - Nan::ThrowTypeError("'max_size' must be a positive integer between 0 and 65535"); - return; - } - max_size = static_cast(max_size_val); - } -- if (options->Has(Nan::New("strict").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strict").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("strict").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("strict").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsBoolean()) - { - Nan::ThrowTypeError("'strict' must be a boolean value"); - return; - } -- strict = opt->BooleanValue(); -+ strict = Nan::To(opt).FromJust(); - } - } - -@@ -3210,20 +3219,21 @@ void Image::EIO_FromSVGBytes(uv_work_t* req) - void Image::EIO_AfterFromSVGBytes(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - svg_mem_ptr_baton_t *closure = static_cast(req->data); - if (closure->error || !closure->im) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - Image* im = new Image(closure->im); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->cb.Reset(); - closure->buffer.Reset(); -@@ -3262,8 +3272,8 @@ v8::Local Image::_fromBufferSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - -- unsigned width = info[0]->IntegerValue(); -- unsigned height = info[1]->IntegerValue(); -+ unsigned width = Nan::To(info[0]).FromJust(); -+ unsigned height = Nan::To(info[1]).FromJust(); - - if (width <= 0 || height <= 0) - { -@@ -3271,7 +3281,7 @@ v8::Local Image::_fromBufferSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - -- v8::Local obj = info[2]->ToObject(); -+ v8::Local obj = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) { - Nan::ThrowTypeError("third argument is invalid, must be a Buffer"); - return scope.Escape(Nan::Undefined()); -@@ -3292,18 +3302,18 @@ v8::Local Image::_fromBufferSync(Nan::NAN_METHOD_ARGS_TYPE info) - if (info[3]->IsObject()) - { - v8::Local options = v8::Local::Cast(info[3]); -- if (options->Has(Nan::New("type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("type").ToLocalChecked()).FromMaybe(false)) - { - Nan::ThrowTypeError("'type' option not supported (only rgba images currently viable)"); - return scope.Escape(Nan::Undefined()); - } - -- if (options->Has(Nan::New("premultiplied").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("premultiplied").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local pre_val = options->Get(Nan::New("premultiplied").ToLocalChecked()); -+ v8::Local pre_val = Nan::Get(options, Nan::New("premultiplied").ToLocalChecked()).ToLocalChecked(); - if (!pre_val.IsEmpty() && pre_val->IsBoolean()) - { -- premultiplied = pre_val->BooleanValue(); -+ premultiplied = Nan::To(pre_val).FromJust(); - } - else - { -@@ -3312,12 +3322,12 @@ v8::Local Image::_fromBufferSync(Nan::NAN_METHOD_ARGS_TYPE info) - } - } - -- if (options->Has(Nan::New("painted").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("painted").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local painted_val = options->Get(Nan::New("painted").ToLocalChecked()); -+ v8::Local painted_val = Nan::Get(options, Nan::New("painted").ToLocalChecked()).ToLocalChecked(); - if (!painted_val.IsEmpty() && painted_val->IsBoolean()) - { -- painted = painted_val->BooleanValue(); -+ painted = Nan::To(painted_val).FromJust(); - } - else - { -@@ -3339,10 +3349,10 @@ v8::Local Image::_fromBufferSync(Nan::NAN_METHOD_ARGS_TYPE info) - image_ptr imagep = std::make_shared(im_wrapper); - Image* im = new Image(imagep); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); -- v8::Local image_obj = maybe_local.ToLocalChecked()->ToObject(); -- image_obj->Set(Nan::New("_buffer").ToLocalChecked(),obj); -+ v8::Local image_obj = maybe_local.ToLocalChecked()->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ Nan::Set(image_obj, Nan::New("_buffer").ToLocalChecked(),obj); - return scope.Escape(maybe_local.ToLocalChecked()); - } - catch (std::exception const& ex) -@@ -3381,7 +3391,7 @@ v8::Local Image::_fromBytesSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) { - Nan::ThrowTypeError("first argument is invalid, must be a Buffer"); - return scope.Escape(Nan::Undefined()); -@@ -3395,7 +3405,7 @@ v8::Local Image::_fromBytesSync(Nan::NAN_METHOD_ARGS_TYPE info) - image_ptr imagep = std::make_shared(reader->read(0,0,reader->width(),reader->height())); - Image* im = new Image(imagep); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -3449,7 +3459,7 @@ NAN_METHOD(Image::fromBytes) - return; - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) { - Nan::ThrowTypeError("first argument is invalid, must be a Buffer"); - return; -@@ -3469,12 +3479,12 @@ NAN_METHOD(Image::fromBytes) - if (info[1]->IsObject()) - { - v8::Local options = v8::Local::Cast(info[1]); -- if (options->Has(Nan::New("premultiply").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("premultiply").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("premultiply").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("premultiply").ToLocalChecked()).ToLocalChecked(); - if (!opt.IsEmpty() && opt->IsBoolean()) - { -- premultiply = opt->BooleanValue(); -+ premultiply = Nan::To(opt).FromJust(); - } - else - { -@@ -3482,12 +3492,12 @@ NAN_METHOD(Image::fromBytes) - return; - } - } -- if (options->Has(Nan::New("max_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("max_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("max_size").ToLocalChecked()).ToLocalChecked(); - if (opt->IsNumber()) - { -- auto max_size_val = opt->IntegerValue(); -+ auto max_size_val = Nan::To(opt).FromJust(); - if (max_size_val < 0 || max_size_val > 65535) { - Nan::ThrowTypeError("max_size must be a positive integer between 0 and 65535"); - return; -@@ -3547,11 +3557,12 @@ void Image::EIO_FromBytes(uv_work_t* req) - void Image::EIO_AfterFromBytes(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - image_mem_ptr_baton_t *closure = static_cast(req->data); - if (!closure->error_name.empty()) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else if (closure->im == nullptr) - { -@@ -3560,16 +3571,16 @@ void Image::EIO_AfterFromBytes(uv_work_t* req) - // mapnik was not providing an image type it should. This should never - // be occuring so marking this out from coverage - v8::Local argv[1] = { Nan::Error("Failed to load from buffer") }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - /* LCOV_EXCL_STOP */ - } else - { - Image* im = new Image(closure->im); - v8::Local ext = Nan::New(im); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); - v8::Local argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->cb.Reset(); - closure->buffer.Reset(); -@@ -3615,16 +3626,16 @@ NAN_METHOD(Image::encodeSync) - Nan::ThrowTypeError("optional second arg must be an options object"); - return; - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; - } - -- v8::Local obj = format_opt->ToObject(); -+ v8::Local obj = format_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Palette::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Palette expected as second arg"); - return; -@@ -3715,9 +3726,9 @@ NAN_METHOD(Image::encode) - - v8::Local options = info[1].As(); - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; -@@ -3777,17 +3788,18 @@ void Image::EIO_Encode(uv_work_t* req) - void Image::EIO_AfterEncode(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - - encode_image_baton_t *closure = static_cast(req->data); - - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::CopyBuffer((char*)closure->result.data(), closure->result.size()).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->im->Unref(); -@@ -3821,10 +3833,10 @@ NAN_METHOD(Image::view) - } - - // TODO parse args -- unsigned x = info[0]->IntegerValue(); -- unsigned y = info[1]->IntegerValue(); -- unsigned w = info[2]->IntegerValue(); -- unsigned h = info[3]->IntegerValue(); -+ unsigned x = Nan::To(info[0]).FromJust(); -+ unsigned y = Nan::To(info[1]).FromJust(); -+ unsigned w = Nan::To(info[2]).FromJust(); -+ unsigned h = Nan::To(info[3]).FromJust(); - - Image* im = Nan::ObjectWrap::Unwrap(info.Holder()); - info.GetReturnValue().Set(ImageView::NewInstance(im,x,y,w,h)); -@@ -3980,16 +3992,17 @@ void Image::EIO_Save(uv_work_t* req) - void Image::EIO_AfterSave(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - save_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - closure->im->Unref(); - closure->cb.Reset(); -@@ -4096,15 +4109,15 @@ NAN_METHOD(Image::composite) - - v8::Local options = info[1].As(); - -- if (options->Has(Nan::New("comp_op").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("comp_op").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("comp_op").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("comp_op").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("comp_op must be a mapnik.compositeOp value"); - return; - } -- int mode_int = opt->IntegerValue(); -+ int mode_int = Nan::To(opt).FromJust(); - if (mode_int > static_cast(mapnik::composite_mode_e::divide) || mode_int < 0) - { - Nan::ThrowTypeError("Invalid comp_op value"); -@@ -4113,43 +4126,43 @@ NAN_METHOD(Image::composite) - mode = static_cast(mode_int); - } - -- if (options->Has(Nan::New("opacity").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("opacity").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("opacity").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("opacity").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) { - Nan::ThrowTypeError("opacity must be a floating point number"); - return; - } -- opacity = opt->NumberValue(); -+ opacity = Nan::To(opt).FromJust(); - if (opacity < 0 || opacity > 1) { - Nan::ThrowTypeError("opacity must be a floating point number between 0-1"); - return; - } - } - -- if (options->Has(Nan::New("dx").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("dx").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("dx").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("dx").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) { - Nan::ThrowTypeError("dx must be an integer"); - return; - } -- dx = opt->IntegerValue(); -+ dx = Nan::To(opt).FromJust(); - } - -- if (options->Has(Nan::New("dy").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("dy").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("dy").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("dy").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) { - Nan::ThrowTypeError("dy must be an integer"); - return; - } -- dy = opt->IntegerValue(); -+ dy = Nan::To(opt).FromJust(); - } - -- if (options->Has(Nan::New("image_filters").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_filters").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("image_filters").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("image_filters").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsString()) { - Nan::ThrowTypeError("image_filters argument must string of filter names"); - return; -@@ -4209,16 +4222,17 @@ void Image::EIO_Composite(uv_work_t* req) - void Image::EIO_AfterComposite(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - - composite_image_baton_t *closure = static_cast(req->data); - - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[2] = { Nan::Null(), closure->im1->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->im1->Unref(); -@@ -4248,7 +4262,7 @@ NAN_SETTER(Image::set_scaling) - } - else - { -- double val = value->NumberValue(); -+ double val = Nan::To(value).FromJust(); - if (val == 0.0) - { - Nan::ThrowError("Scaling value can not be zero"); -@@ -4267,7 +4281,7 @@ NAN_SETTER(Image::set_offset) - } - else - { -- double val = value->NumberValue(); -+ double val = Nan::To(value).FromJust(); - im->this_->set_offset(val); - } - } -diff --git a/src/mapnik_image_view.cpp b/src/mapnik_image_view.cpp -index 36a18c4b..1d678507 100644 ---- a/src/mapnik_image_view.cpp -+++ b/src/mapnik_image_view.cpp -@@ -47,7 +47,7 @@ void ImageView::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "isSolidSync", isSolidSync); - Nan::SetPrototypeMethod(lcons, "getPixel", getPixel); - -- target->Set(Nan::New("ImageView").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("ImageView").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -98,7 +98,7 @@ v8::Local ImageView::NewInstance(Image * JSImage , - ImageView* imv = new ImageView(JSImage); - imv->this_ = std::make_shared(mapnik::create_view(*(JSImage->get()),x,y,w,h)); - v8::Local ext = Nan::New(imv); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new ImageView instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -253,10 +253,11 @@ struct visitor_get_pixel_view - void ImageView::EIO_AfterIsSolid(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - is_solid_image_view_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { -@@ -266,12 +267,12 @@ void ImageView::EIO_AfterIsSolid(uv_work_t* req) - Nan::New(closure->result), - mapnik::util::apply_visitor(visitor_get_pixel_view(0,0),*(closure->im->this_)), - }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 3, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::New(closure->result) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - closure->im->Unref(); -@@ -314,15 +315,15 @@ NAN_METHOD(ImageView::getPixel) - return; - } - -- v8::Local options = info[2]->ToObject(); -+ v8::Local options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("get_color").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("get_color").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("get_color").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("get_color").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsBoolean()) { - Nan::ThrowTypeError("optional arg 'color' must be a boolean"); - return; - } -- get_color = bind_opt->BooleanValue(); -+ get_color = Nan::To(bind_opt).FromJust(); - } - - } -@@ -336,8 +337,8 @@ NAN_METHOD(ImageView::getPixel) - Nan::ThrowTypeError("second arg, 'y' must be an integer"); - return; - } -- x = info[0]->IntegerValue(); -- y = info[1]->IntegerValue(); -+ x = Nan::To(info[0]).FromJust(); -+ y = Nan::To(info[1]).FromJust(); - } else { - Nan::ThrowTypeError("must supply x,y to query pixel color"); - return; -@@ -398,9 +399,9 @@ NAN_METHOD(ImageView::encodeSync) - - v8::Local options = info[1].As(); - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; -@@ -471,9 +472,9 @@ NAN_METHOD(ImageView::encode) - - v8::Local options = info[1].As(); - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; -@@ -530,17 +531,18 @@ void ImageView::AsyncEncode(uv_work_t* req) - void ImageView::AfterEncode(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - - encode_image_view_baton_t *baton = static_cast(req->data); - - if (!baton->error_name.empty()) { - v8::Local argv[1] = { Nan::Error(baton->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(baton->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(baton->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::CopyBuffer((char*)baton->result.data(), baton->result.size()).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(baton->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(baton->cb), 2, argv); - } - - baton->im->Unref(); -diff --git a/src/mapnik_layer.cpp b/src/mapnik_layer.cpp -index d5801951..2f54f187 100644 ---- a/src/mapnik_layer.cpp -+++ b/src/mapnik_layer.cpp -@@ -38,7 +38,7 @@ void Layer::Initialize(v8::Local target) { - ATTR(lcons, "queryable", get_prop, set_prop); - ATTR(lcons, "clear_label_cache", get_prop, set_prop); - -- target->Set(Nan::New("Layer").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Layer").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -111,7 +111,7 @@ v8::Local Layer::NewInstance(mapnik::layer const& lay_ref) { - // copy new mapnik::layer into the shared_ptr - l->layer_ = std::make_shared(lay_ref); - v8::Local ext = Nan::New(l); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Layer instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -129,7 +129,7 @@ NAN_GETTER(Layer::get_prop) - v8::Local s = Nan::New(style_names.size()); - for (unsigned i = 0; i < style_names.size(); ++i) - { -- s->Set(i, Nan::New(style_names[i]).ToLocalChecked() ); -+ Nan::Set(s, i, Nan::New(style_names[i]).ToLocalChecked() ); - } - info.GetReturnValue().Set(s); - } -@@ -204,7 +204,7 @@ NAN_SETTER(Layer::set_prop) - unsigned int i = 0; - unsigned int a_length = arr->Length(); - while (i < a_length) { -- l->layer_->add_style(TOSTR(arr->Get(i))); -+ l->layer_->add_style(TOSTR(Nan::Get(arr, i).ToLocalChecked())); - i++; - } - } -@@ -243,7 +243,7 @@ NAN_SETTER(Layer::set_prop) - Nan::ThrowTypeError("Must provide a number"); - return; - } -- l->layer_->set_minimum_scale_denominator(value->NumberValue()); -+ l->layer_->set_minimum_scale_denominator(Nan::To(value).FromJust()); - } - else if (a == "maximum_scale_denominator") - { -@@ -251,7 +251,7 @@ NAN_SETTER(Layer::set_prop) - Nan::ThrowTypeError("Must provide a number"); - return; - } -- l->layer_->set_maximum_scale_denominator(value->NumberValue()); -+ l->layer_->set_maximum_scale_denominator(Nan::To(value).FromJust()); - } - else if (a == "queryable") - { -@@ -259,7 +259,7 @@ NAN_SETTER(Layer::set_prop) - Nan::ThrowTypeError("Must provide a boolean"); - return; - } -- l->layer_->set_queryable(value->BooleanValue()); -+ l->layer_->set_queryable(Nan::To(value).FromJust()); - } - else if (a == "clear_label_cache") - { -@@ -267,7 +267,7 @@ NAN_SETTER(Layer::set_prop) - Nan::ThrowTypeError("Must provide a boolean"); - return; - } -- l->layer_->set_clear_label_cache(value->BooleanValue()); -+ l->layer_->set_clear_label_cache(Nan::To(value).FromJust()); - } - else if (a == "active") - { -@@ -275,7 +275,7 @@ NAN_SETTER(Layer::set_prop) - Nan::ThrowTypeError("Must provide a boolean"); - return; - } -- l->layer_->set_active(value->BooleanValue()); -+ l->layer_->set_active(Nan::To(value).FromJust()); - } - } - -@@ -286,32 +286,32 @@ NAN_METHOD(Layer::describe) - v8::Local description = Nan::New(); - mapnik::layer const& layer = *l->layer_; - -- description->Set(Nan::New("name").ToLocalChecked(), Nan::New(layer.name()).ToLocalChecked()); -+ Nan::Set(description, Nan::New("name").ToLocalChecked(), Nan::New(layer.name()).ToLocalChecked()); - -- description->Set(Nan::New("srs").ToLocalChecked(), Nan::New(layer.srs()).ToLocalChecked()); -+ Nan::Set(description, Nan::New("srs").ToLocalChecked(), Nan::New(layer.srs()).ToLocalChecked()); - -- description->Set(Nan::New("active").ToLocalChecked(), Nan::New(layer.active())); -+ Nan::Set(description, Nan::New("active").ToLocalChecked(), Nan::New(layer.active())); - -- description->Set(Nan::New("clear_label_cache").ToLocalChecked(), Nan::New(layer.clear_label_cache())); -+ Nan::Set(description, Nan::New("clear_label_cache").ToLocalChecked(), Nan::New(layer.clear_label_cache())); - -- description->Set(Nan::New("minimum_scale_denominator").ToLocalChecked(), Nan::New(layer.minimum_scale_denominator())); -+ Nan::Set(description, Nan::New("minimum_scale_denominator").ToLocalChecked(), Nan::New(layer.minimum_scale_denominator())); - -- description->Set(Nan::New("maximum_scale_denominator").ToLocalChecked(), Nan::New(layer.maximum_scale_denominator())); -+ Nan::Set(description, Nan::New("maximum_scale_denominator").ToLocalChecked(), Nan::New(layer.maximum_scale_denominator())); - -- description->Set(Nan::New("queryable").ToLocalChecked(), Nan::New(layer.queryable())); -+ Nan::Set(description, Nan::New("queryable").ToLocalChecked(), Nan::New(layer.queryable())); - - std::vector const& style_names = layer.styles(); - v8::Local s = Nan::New(style_names.size()); - for (unsigned i = 0; i < style_names.size(); ++i) - { -- s->Set(i, Nan::New(style_names[i]).ToLocalChecked() ); -+ Nan::Set(s, i, Nan::New(style_names[i]).ToLocalChecked() ); - } - -- description->Set(Nan::New("styles").ToLocalChecked(), s ); -+ Nan::Set(description, Nan::New("styles").ToLocalChecked(), s ); - - mapnik::datasource_ptr datasource = layer.datasource(); - v8::Local ds = Nan::New(); -- description->Set(Nan::New("datasource").ToLocalChecked(), ds ); -+ Nan::Set(description, Nan::New("datasource").ToLocalChecked(), ds ); - if ( datasource ) - { - mapnik::parameters::const_iterator it = datasource->params().begin(); -diff --git a/src/mapnik_logger.cpp b/src/mapnik_logger.cpp -index 130f5aa2..2af29adf 100644 ---- a/src/mapnik_logger.cpp -+++ b/src/mapnik_logger.cpp -@@ -23,14 +23,14 @@ void Logger::Initialize(v8::Local target) { - lcons->SetClassName(Nan::New("Logger").ToLocalChecked()); - - // Static methods -- Nan::SetMethod(lcons->GetFunction().As(), "getSeverity", Logger::get_severity); -- Nan::SetMethod(lcons->GetFunction().As(), "setSeverity", Logger::set_severity); -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), "getSeverity", Logger::get_severity); -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), "setSeverity", Logger::set_severity); - - // Constants -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"NONE",mapnik::logger::severity_type::none); -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"ERROR",mapnik::logger::severity_type::error); -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"DEBUG",mapnik::logger::severity_type::debug); -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(),"WARN",mapnik::logger::severity_type::warn); -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(),"NONE",mapnik::logger::severity_type::none); -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(),"ERROR",mapnik::logger::severity_type::error); -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(),"DEBUG",mapnik::logger::severity_type::debug); -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(),"WARN",mapnik::logger::severity_type::warn); - - // What about booleans like: - // ENABLE_STATS -@@ -40,7 +40,7 @@ void Logger::Initialize(v8::Local target) { - // DEBUG - - // Not sure if needed... -- target->Set(Nan::New("Logger").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Logger").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - - } -@@ -79,7 +79,7 @@ NAN_METHOD(Logger::set_severity){ - return; - } - -- int severity = info[0]->IntegerValue(); -+ int severity = Nan::To(info[0]).FromJust(); - mapnik::logger::instance().set_severity(static_cast(severity)); - return; - } -diff --git a/src/mapnik_map.cpp b/src/mapnik_map.cpp -index a14c5be4..8e96dd04 100644 ---- a/src/mapnik_map.cpp -+++ b/src/mapnik_map.cpp -@@ -144,25 +144,25 @@ void Map::Initialize(v8::Local target) { - ATTR(lcons, "parameters", get_prop, set_prop); - ATTR(lcons, "aspect_fix_mode", get_prop, set_prop); - -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_GROW_BBOX",mapnik::Map::GROW_BBOX) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_GROW_CANVAS",mapnik::Map::GROW_CANVAS) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_SHRINK_BBOX",mapnik::Map::SHRINK_BBOX) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_SHRINK_CANVAS",mapnik::Map::SHRINK_CANVAS) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_ADJUST_BBOX_WIDTH",mapnik::Map::ADJUST_BBOX_WIDTH) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_ADJUST_BBOX_HEIGHT",mapnik::Map::ADJUST_BBOX_HEIGHT) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_ADJUST_CANVAS_WIDTH",mapnik::Map::ADJUST_CANVAS_WIDTH) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_ADJUST_CANVAS_HEIGHT",mapnik::Map::ADJUST_CANVAS_HEIGHT) -- NODE_MAPNIK_DEFINE_CONSTANT(lcons->GetFunction(), -+ NODE_MAPNIK_DEFINE_CONSTANT(Nan::GetFunction(lcons).ToLocalChecked(), - "ASPECT_RESPECT",mapnik::Map::RESPECT) -- target->Set(Nan::New("Map").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Map").ToLocalChecked(),Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -222,7 +222,7 @@ NAN_METHOD(Map::New) - Nan::ThrowTypeError("'width' and 'height' must be integers"); - return; - } -- Map* m = new Map(info[0]->IntegerValue(),info[1]->IntegerValue()); -+ Map* m = new Map(Nan::To(info[0]).FromJust(),Nan::To(info[1]).FromJust()); - m->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - return; -@@ -239,7 +239,7 @@ NAN_METHOD(Map::New) - Nan::ThrowError("'srs' value must be a string"); - return; - } -- Map* m = new Map(info[0]->IntegerValue(), info[1]->IntegerValue(), TOSTR(info[2])); -+ Map* m = new Map(Nan::To(info[0]).FromJust(), Nan::To(info[1]).FromJust(), TOSTR(info[2])); - m->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - return; -@@ -259,19 +259,19 @@ NAN_GETTER(Map::get_prop) - if(a == "extent") { - v8::Local arr = Nan::New(4); - mapnik::box2d const& e = m->map_->get_current_extent(); -- arr->Set(0, Nan::New(e.minx())); -- arr->Set(1, Nan::New(e.miny())); -- arr->Set(2, Nan::New(e.maxx())); -- arr->Set(3, Nan::New(e.maxy())); -+ Nan::Set(arr, 0, Nan::New(e.minx())); -+ Nan::Set(arr, 1, Nan::New(e.miny())); -+ Nan::Set(arr, 2, Nan::New(e.maxx())); -+ Nan::Set(arr, 3, Nan::New(e.maxy())); - info.GetReturnValue().Set(arr); - } - else if(a == "bufferedExtent") { - boost::optional > const& e = m->map_->get_buffered_extent(); - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(e->minx())); -- arr->Set(1, Nan::New(e->miny())); -- arr->Set(2, Nan::New(e->maxx())); -- arr->Set(3, Nan::New(e->maxy())); -+ Nan::Set(arr, 0, Nan::New(e->minx())); -+ Nan::Set(arr, 1, Nan::New(e->miny())); -+ Nan::Set(arr, 2, Nan::New(e->maxx())); -+ Nan::Set(arr, 3, Nan::New(e->maxy())); - info.GetReturnValue().Set(arr); - } - else if(a == "maximumExtent") { -@@ -279,10 +279,10 @@ NAN_GETTER(Map::get_prop) - if (!e) - return; - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(e->minx())); -- arr->Set(1, Nan::New(e->miny())); -- arr->Set(2, Nan::New(e->maxx())); -- arr->Set(3, Nan::New(e->maxy())); -+ Nan::Set(arr, 0, Nan::New(e->minx())); -+ Nan::Set(arr, 1, Nan::New(e->miny())); -+ Nan::Set(arr, 2, Nan::New(e->maxx())); -+ Nan::Set(arr, 3, Nan::New(e->maxy())); - info.GetReturnValue().Set(arr); - } - else if(a == "aspect_fix_mode") -@@ -330,10 +330,10 @@ NAN_SETTER(Map::set_prop) - Nan::ThrowError("Must provide an array of: [minx,miny,maxx,maxy]"); - return; - } else { -- double minx = arr->Get(0)->NumberValue(); -- double miny = arr->Get(1)->NumberValue(); -- double maxx = arr->Get(2)->NumberValue(); -- double maxy = arr->Get(3)->NumberValue(); -+ double minx = Nan::To(Nan::Get(arr, 0).ToLocalChecked()).FromJust(); -+ double miny = Nan::To(Nan::Get(arr, 1).ToLocalChecked()).FromJust(); -+ double maxx = Nan::To(Nan::Get(arr, 2).ToLocalChecked()).FromJust(); -+ double maxy = Nan::To(Nan::Get(arr, 3).ToLocalChecked()).FromJust(); - mapnik::box2d box(minx,miny,maxx,maxy); - if(a == "extent") - m->map_->zoom_to_box(box); -@@ -348,7 +348,7 @@ NAN_SETTER(Map::set_prop) - Nan::ThrowError("'aspect_fix_mode' must be a constant (number)"); - return; - } else { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val < mapnik::Map::aspect_fix_mode_MAX && val >= 0) { - m->map_->set_aspect_fix_mode(static_cast(val)); - } else { -@@ -371,7 +371,7 @@ NAN_SETTER(Map::set_prop) - Nan::ThrowTypeError("Must provide an integer bufferSize"); - return; - } else { -- m->map_->set_buffer_size(value->IntegerValue()); -+ m->map_->set_buffer_size(Nan::To(value).FromJust()); - } - } - else if (a == "width") { -@@ -379,7 +379,7 @@ NAN_SETTER(Map::set_prop) - Nan::ThrowTypeError("Must provide an integer width"); - return; - } else { -- m->map_->set_width(value->IntegerValue()); -+ m->map_->set_width(Nan::To(value).FromJust()); - } - } - else if (a == "height") { -@@ -387,7 +387,7 @@ NAN_SETTER(Map::set_prop) - Nan::ThrowTypeError("Must provide an integer height"); - return; - } else { -- m->map_->set_height(value->IntegerValue()); -+ m->map_->set_height(Nan::To(value).FromJust()); - } - } - else if (a == "background") { -@@ -410,27 +410,27 @@ NAN_SETTER(Map::set_prop) - return; - } - -- v8::Local obj = value->ToObject(); -+ v8::Local obj = value->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - mapnik::parameters params; -- v8::Local names = obj->GetPropertyNames(); -+ v8::Local names = Nan::GetPropertyNames(obj).ToLocalChecked(); - unsigned int i = 0; - unsigned int a_length = names->Length(); - while (i < a_length) { -- v8::Local name = names->Get(i)->ToString(); -- v8::Local a_value = obj->Get(name); -+ v8::Local name = Nan::Get(names, i).ToLocalChecked()->ToString(Nan::GetCurrentContext()).ToLocalChecked(); -+ v8::Local a_value = Nan::Get(obj, name).ToLocalChecked(); - if (a_value->IsString()) { - params[TOSTR(name)] = const_cast(TOSTR(a_value)); - } else if (a_value->IsNumber()) { -- double num = a_value->NumberValue(); -+ double num = Nan::To(a_value).FromJust(); - // todo - round -- if (num == a_value->IntegerValue()) { -- params[TOSTR(name)] = static_cast(a_value->IntegerValue()); -+ if (num == Nan::To(a_value).FromJust()) { -+ params[TOSTR(name)] = Nan::To(a_value).FromJust(); - } else { -- double dub_val = a_value->NumberValue(); -+ double dub_val = Nan::To(a_value).FromJust(); - params[TOSTR(name)] = dub_val; - } - } else if (a_value->IsBoolean()) { -- params[TOSTR(name)] = static_cast(a_value->BooleanValue()); -+ params[TOSTR(name)] = Nan::To(a_value).FromJust(); - } - i++; - } -@@ -460,7 +460,7 @@ NAN_METHOD(Map::memoryFonts) - unsigned i = 0; - for (auto const& kv : font_cache) - { -- a->Set(i++, Nan::New(kv.first).ToLocalChecked()); -+ Nan::Set(a, i++, Nan::New(kv.first).ToLocalChecked()); - } - info.GetReturnValue().Set(a); - } -@@ -484,15 +484,15 @@ NAN_METHOD(Map::registerFonts) - return; - } - v8::Local options = info[1].As(); -- if (options->Has(Nan::New("recurse").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("recurse").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local recurse_opt = options->Get(Nan::New("recurse").ToLocalChecked()); -+ v8::Local recurse_opt = Nan::Get(options, Nan::New("recurse").ToLocalChecked()).ToLocalChecked(); - if (!recurse_opt->IsBoolean()) - { - Nan::ThrowTypeError("'recurse' must be a Boolean"); - return; - } -- recurse = recurse_opt->BooleanValue(); -+ recurse = Nan::To(recurse_opt).FromJust(); - } - } - std::string path = TOSTR(info[0]); -@@ -514,7 +514,7 @@ NAN_METHOD(Map::fonts) - unsigned i = 0; - for (auto const& kv : mapping) - { -- a->Set(i++, Nan::New(kv.first).ToLocalChecked()); -+ Nan::Set(a, i++, Nan::New(kv.first).ToLocalChecked()); - } - info.GetReturnValue().Set(a); - } -@@ -534,7 +534,7 @@ NAN_METHOD(Map::fontFiles) - v8::Local obj = Nan::New(); - for (auto const& kv : mapping) - { -- obj->Set(Nan::New(kv.first).ToLocalChecked(), Nan::New(kv.second.second).ToLocalChecked()); -+ Nan::Set(obj, Nan::New(kv.first).ToLocalChecked(), Nan::New(kv.second.second).ToLocalChecked()); - } - info.GetReturnValue().Set(obj); - } -@@ -687,8 +687,8 @@ v8::Local Map::abstractQueryPoint(Nan::NAN_METHOD_ARGS_TYPE info, boo - } - else - { -- x = info[0]->NumberValue(); -- y = info[1]->NumberValue(); -+ x = Nan::To(info[0]).FromJust(); -+ y = Nan::To(info[1]).FromJust(); - } - - Map* m = Nan::ObjectWrap::Unwrap(info.Holder()); -@@ -704,12 +704,12 @@ v8::Local Map::abstractQueryPoint(Nan::NAN_METHOD_ARGS_TYPE info, boo - return Nan::Undefined(); - } - -- options = info[2]->ToObject(); -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("layer").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("layer").ToLocalChecked()).FromMaybe(false)) - { - std::vector const& layers = m->map_->layers(); -- v8::Local layer_id = options->Get(Nan::New("layer").ToLocalChecked()); -+ v8::Local layer_id = Nan::Get(options, Nan::New("layer").ToLocalChecked()).ToLocalChecked(); - if (! (layer_id->IsString() || layer_id->IsNumber()) ) { - Nan::ThrowTypeError("'layer' option required for map query and must be either a layer name(string) or layer index (integer)"); - return Nan::Undefined(); -@@ -739,7 +739,7 @@ v8::Local Map::abstractQueryPoint(Nan::NAN_METHOD_ARGS_TYPE info, boo - } - else if (layer_id->IsNumber()) - { -- layer_idx = layer_id->IntegerValue(); -+ layer_idx = Nan::To(layer_id).FromJust(); - std::size_t layer_num = layers.size(); - - if (layer_idx < 0) { -@@ -854,10 +854,11 @@ void Map::EIO_QueryMap(uv_work_t* req) - void Map::EIO_AfterQueryMap(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - query_map_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - std::size_t num_result = closure->featuresets.size(); - if (num_result >= 1) -@@ -870,19 +871,19 @@ void Map::EIO_AfterQueryMap(uv_work_t* req) - for (; it != end; ++it) - { - v8::Local obj = Nan::New(); -- obj->Set(Nan::New("layer").ToLocalChecked(), Nan::New(it->first).ToLocalChecked()); -- obj->Set(Nan::New("featureset").ToLocalChecked(), Featureset::NewInstance(it->second)); -- a->Set(idx, obj); -+ Nan::Set(obj, Nan::New("layer").ToLocalChecked(), Nan::New(it->first).ToLocalChecked()); -+ Nan::Set(obj, Nan::New("featureset").ToLocalChecked(), Featureset::NewInstance(it->second)); -+ Nan::Set(a, idx, obj); - ++idx; - } - closure->featuresets.clear(); - v8::Local argv[2] = { Nan::Null(), a }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::Undefined() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - -@@ -906,7 +907,7 @@ NAN_METHOD(Map::layers) - v8::Local a = Nan::New(layers.size()); - for (unsigned i = 0; i < layers.size(); ++i ) - { -- a->Set(i, Layer::NewInstance(layers[i])); -+ Nan::Set(a, i, Layer::NewInstance(layers[i])); - } - info.GetReturnValue().Set(a); - } -@@ -959,7 +960,7 @@ NAN_METHOD(Map::get_layer) - v8::Local layer = info[0]; - if (layer->IsNumber()) - { -- unsigned int index = info[0]->IntegerValue(); -+ unsigned int index = Nan::To(info[0]).FromJust(); - - if (index < layers.size()) - { -@@ -1036,7 +1037,7 @@ NAN_METHOD(Map::resize) - } - - Map* m = Nan::ObjectWrap::Unwrap(info.Holder()); -- m->map_->resize(info[0]->IntegerValue(),info[1]->IntegerValue()); -+ m->map_->resize(Nan::To(info[0]).FromJust(),Nan::To(info[1]).FromJust()); - return; - } - -@@ -1095,14 +1096,14 @@ NAN_METHOD(Map::load) - - bool strict = false; - v8::Local param = Nan::New("strict").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsBoolean()) { - Nan::ThrowTypeError("'strict' must be a Boolean"); - return; - } -- strict = param_val->BooleanValue(); -+ strict = Nan::To(param_val).FromJust(); - } - - Map* m = Nan::ObjectWrap::Unwrap(info.Holder()); -@@ -1111,9 +1112,9 @@ NAN_METHOD(Map::load) - closure->request.data = closure; - - param = Nan::New("base").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsString()) { - Nan::ThrowTypeError("'base' must be a string representing a filesystem path"); - return; -@@ -1149,13 +1150,14 @@ void Map::EIO_Load(uv_work_t* req) - void Map::EIO_AfterLoad(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - load_xml_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[2] = { Nan::Null(), closure->m->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->m->Unref(); -@@ -1206,21 +1208,21 @@ NAN_METHOD(Map::loadSync) - v8::Local options = info[1].As(); - - v8::Local param = Nan::New("strict").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("'strict' must be a Boolean"); - return; - } -- strict = param_val->BooleanValue(); -+ strict = Nan::To(param_val).FromJust(); - } - - param = Nan::New("base").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("'base' must be a string representing a filesystem path"); -@@ -1282,20 +1284,20 @@ NAN_METHOD(Map::fromStringSync) - v8::Local options = info[1].As(); - - v8::Local param = Nan::New("strict").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsBoolean()) { - Nan::ThrowTypeError("'strict' must be a Boolean"); - return; - } -- strict = param_val->BooleanValue(); -+ strict = Nan::To(param_val).FromJust(); - } - - param = Nan::New("base").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsString()) { - Nan::ThrowTypeError("'base' must be a string representing a filesystem path"); - return; -@@ -1367,19 +1369,19 @@ NAN_METHOD(Map::fromString) - return; - } - -- v8::Local options = info[1]->ToObject(); -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - - bool strict = false; - v8::Local param = Nan::New("strict").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("'strict' must be a Boolean"); - return; - } -- strict = param_val->BooleanValue(); -+ strict = Nan::To(param_val).FromJust(); - } - - Map* m = Nan::ObjectWrap::Unwrap(info.Holder()); -@@ -1388,9 +1390,9 @@ NAN_METHOD(Map::fromString) - closure->request.data = closure; - - param = Nan::New("base").ToLocalChecked(); -- if (options->Has(param)) -+ if (Nan::Has(options, param).ToChecked()) - { -- v8::Local param_val = options->Get(param); -+ v8::Local param_val = Nan::Get(options, param).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("'base' must be a string representing a filesystem path"); -@@ -1427,13 +1429,14 @@ void Map::EIO_FromString(uv_work_t* req) - void Map::EIO_AfterFromString(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - load_xml_baton_t *closure = static_cast(req->data); - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[2] = { Nan::Null(), closure->m->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->m->Unref(); -@@ -1456,7 +1459,7 @@ NAN_METHOD(Map::clone) - Map* m2 = new Map(); - m2->map_ = std::make_shared(*m->map_); - v8::Local ext = Nan::New(m2); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Map instance"); - else info.GetReturnValue().Set(maybe_local.ToLocalChecked()); - } -@@ -1536,10 +1539,10 @@ NAN_METHOD(Map::zoomToBox) - return; - } - v8::Local a = info[0].As(); -- minx = a->Get(0)->NumberValue(); -- miny = a->Get(1)->NumberValue(); -- maxx = a->Get(2)->NumberValue(); -- maxy = a->Get(3)->NumberValue(); -+ minx = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ miny = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); -+ maxx = Nan::To(Nan::Get(a, 2).ToLocalChecked()).FromJust(); -+ maxy = Nan::To(Nan::Get(a, 3).ToLocalChecked()).FromJust(); - - } - else if (info.Length() != 4) -@@ -1552,10 +1555,10 @@ NAN_METHOD(Map::zoomToBox) - info[2]->IsNumber() && - info[3]->IsNumber()) - { -- minx = info[0]->NumberValue(); -- miny = info[1]->NumberValue(); -- maxx = info[2]->NumberValue(); -- maxy = info[3]->NumberValue(); -+ minx = Nan::To(info[0]).FromJust(); -+ miny = Nan::To(info[1]).FromJust(); -+ maxx = Nan::To(info[2]).FromJust(); -+ maxy = Nan::To(info[3]).FromJust(); - } - else - { -@@ -1762,59 +1765,59 @@ NAN_METHOD(Map::render) - return; - } - -- options = info[1]->ToObject(); -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } -- buffer_size = bind_opt->IntegerValue(); -+ buffer_size = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("scale").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } - -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } - -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("offset_x").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("offset_x").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("offset_x").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'offset_x' must be a number"); - return; - } - -- offset_x = bind_opt->IntegerValue(); -+ offset_x = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("offset_y").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("offset_y").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("offset_y").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'offset_y' must be a number"); - return; - } - -- offset_y = bind_opt->IntegerValue(); -+ offset_y = Nan::To(bind_opt).FromJust(); - } - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - - if (Nan::New(Image::constructor)->HasInstance(obj)) { - -@@ -1830,16 +1833,16 @@ NAN_METHOD(Map::render) - closure->offset_y = offset_y; - closure->error = false; - -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - delete closure; - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(closure->variables,bind_opt->ToObject()); -+ object_to_container(closure->variables,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - if (!m->acquire()) - { -@@ -1859,14 +1862,14 @@ NAN_METHOD(Map::render) - std::size_t layer_idx = 0; - - // grid requires special options for now -- if (!options->Has(Nan::New("layer").ToLocalChecked())) { -+ if (!Nan::Has(options, Nan::New("layer").ToLocalChecked()).FromMaybe(false)) { - Nan::ThrowTypeError("'layer' option required for grid rendering and must be either a layer name(string) or layer index (integer)"); - return; - } else { - - std::vector const& layers = m->map_->layers(); - -- v8::Local layer_id = options->Get(Nan::New("layer").ToLocalChecked()); -+ v8::Local layer_id = Nan::Get(options, Nan::New("layer").ToLocalChecked()).ToLocalChecked(); - if (! (layer_id->IsString() || layer_id->IsNumber()) ) { - Nan::ThrowTypeError("'layer' option required for grid rendering and must be either a layer name(string) or layer index (integer)"); - return; -@@ -1894,7 +1897,7 @@ NAN_METHOD(Map::render) - return; - } - } else { // IS NUMBER -- layer_idx = layer_id->IntegerValue(); -+ layer_idx = Nan::To(layer_id).FromJust(); - std::size_t layer_num = layers.size(); - - if (layer_idx >= layer_num) { -@@ -1914,9 +1917,9 @@ NAN_METHOD(Map::render) - } - } - -- if (options->Has(Nan::New("fields").ToLocalChecked())) { -+ if (Nan::Has(options, Nan::New("fields").ToLocalChecked()).FromMaybe(false)) { - -- v8::Local param_val = options->Get(Nan::New("fields").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("fields").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsArray()) { - Nan::ThrowTypeError("option 'fields' must be an array of strings"); - return; -@@ -1925,7 +1928,7 @@ NAN_METHOD(Map::render) - unsigned int i = 0; - unsigned int num_fields = a->Length(); - while (i < num_fields) { -- v8::Local name = a->Get(i); -+ v8::Local name = Nan::Get(a, i).ToLocalChecked(); - if (name->IsString()){ - g->get()->add_field(TOSTR(name)); - } -@@ -1935,16 +1938,16 @@ NAN_METHOD(Map::render) - - grid_baton_t *closure = new grid_baton_t(); - -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - delete closure; - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(closure->variables,bind_opt->ToObject()); -+ object_to_container(closure->variables,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - - closure->request.data = closure; -@@ -1973,9 +1976,9 @@ NAN_METHOD(Map::render) - - vector_tile_baton_t *closure = new vector_tile_baton_t(); - -- if (options->Has(Nan::New("image_scaling").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_scaling").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_scaling").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - delete closure; -@@ -1993,9 +1996,9 @@ NAN_METHOD(Map::render) - closure->scaling_method = *method; - } - -- if (options->Has(Nan::New("image_format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_format").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_format").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - delete closure; -@@ -2005,16 +2008,16 @@ NAN_METHOD(Map::render) - closure->image_format = TOSTR(param_val); - } - -- if (options->Has(Nan::New("area_threshold").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("area_threshold").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("area_threshold").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("area_threshold").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - delete closure; - Nan::ThrowTypeError("option 'area_threshold' must be a number"); - return; - } -- closure->area_threshold = param_val->NumberValue(); -+ closure->area_threshold = Nan::To(param_val).FromJust(); - if (closure->area_threshold < 0.0) - { - delete closure; -@@ -2023,40 +2026,40 @@ NAN_METHOD(Map::render) - } - } - -- if (options->Has(Nan::New("strictly_simple").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strictly_simple").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("strictly_simple").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("strictly_simple").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - delete closure; - Nan::ThrowTypeError("option 'strictly_simple' must be a boolean"); - return; - } -- closure->strictly_simple = param_val->BooleanValue(); -+ closure->strictly_simple = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("multi_polygon_union").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("multi_polygon_union").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("multi_polygon_union").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("multi_polygon_union").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - delete closure; - Nan::ThrowTypeError("option 'multi_polygon_union' must be a boolean"); - return; - } -- closure->multi_polygon_union = param_val->BooleanValue(); -+ closure->multi_polygon_union = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("fill_type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fill_type").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("fill_type").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("fill_type").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - delete closure; - Nan::ThrowTypeError("option 'fill_type' must be an unsigned integer"); - return; - } -- closure->fill_type = static_cast(param_val->IntegerValue()); -+ closure->fill_type = static_cast(Nan::To(param_val).FromJust()); - if (closure->fill_type < 0 || closure->fill_type >= mapnik::vector_tile_impl::polygon_fill_type_max) - { - delete closure; -@@ -2065,16 +2068,16 @@ NAN_METHOD(Map::render) - } - } - -- if (options->Has(Nan::New("threading_mode").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("threading_mode").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("threading_mode").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("threading_mode").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - delete closure; - Nan::ThrowTypeError("option 'threading_mode' must be an unsigned integer"); - return; - } -- closure->threading_mode = static_cast(param_val->IntegerValue()); -+ closure->threading_mode = static_cast(Nan::To(param_val).FromJust()); - if (closure->threading_mode != std::launch::async && - closure->threading_mode != std::launch::deferred && - closure->threading_mode != (std::launch::async | std::launch::deferred)) -@@ -2085,16 +2088,16 @@ NAN_METHOD(Map::render) - } - } - -- if (options->Has(Nan::New("simplify_distance").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("simplify_distance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("simplify_distance").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("simplify_distance").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - delete closure; - Nan::ThrowTypeError("option 'simplify_distance' must be an floating point number"); - return; - } -- closure->simplify_distance = param_val->NumberValue(); -+ closure->simplify_distance = Nan::To(param_val).FromJust(); - if (closure->simplify_distance < 0) - { - delete closure; -@@ -2103,28 +2106,28 @@ NAN_METHOD(Map::render) - } - } - -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - delete closure; - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(closure->variables,bind_opt->ToObject()); -+ object_to_container(closure->variables,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - -- if (options->Has(Nan::New("process_all_rings").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("process_all_rings").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("process_all_rings").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("process_all_rings").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - delete closure; - Nan::ThrowTypeError("option 'process_all_rings' must be a boolean"); - return; - } -- closure->process_all_rings = param_val->BooleanValue(); -+ closure->process_all_rings = Nan::To(param_val).FromJust(); - } - - closure->request.data = closure; -@@ -2198,18 +2201,19 @@ void Map::EIO_RenderVectorTile(uv_work_t* req) - void Map::EIO_AfterRenderVectorTile(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_baton_t *closure = static_cast(req->data); - closure->m->release(); - - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->d->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->m->Unref(); -@@ -2263,6 +2267,8 @@ void Map::EIO_RenderGrid(uv_work_t* req) - void Map::EIO_AfterRenderGrid(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); -+ - grid_baton_t *closure = static_cast(req->data); - closure->m->release(); - -@@ -2270,10 +2276,10 @@ void Map::EIO_AfterRenderGrid(uv_work_t* req) - // TODO - add more attributes - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[2] = { Nan::Null(), closure->g->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->m->Unref(); -@@ -2350,15 +2356,16 @@ void Map::EIO_RenderImage(uv_work_t* req) - void Map::EIO_AfterRenderImage(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - image_baton_t *closure = static_cast(req->data); - closure->m->release(); - - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[2] = { Nan::Null(), closure->im->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->m->Unref(); -@@ -2407,10 +2414,10 @@ NAN_METHOD(Map::renderFile) - v8::Local options = Nan::New(); - - if (!info[1]->IsFunction() && info[1]->IsObject()) { -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("format").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("format").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("format").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsString()) { - Nan::ThrowTypeError("'format' must be a String"); - return; -@@ -2419,15 +2426,15 @@ NAN_METHOD(Map::renderFile) - format = TOSTR(format_opt); - } - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; - } - -- v8::Local obj = format_opt->ToObject(); -+ v8::Local obj = format_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Palette::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Palette expected as second arg"); - return; -@@ -2435,34 +2442,34 @@ NAN_METHOD(Map::renderFile) - - palette = Nan::ObjectWrap::Unwrap(obj)->palette(); - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } - -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } - -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - } - -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } - -- buffer_size = bind_opt->IntegerValue(); -+ buffer_size = Nan::To(bind_opt).FromJust(); - } - - } else if (!info[1]->IsFunction()) { -@@ -2486,16 +2493,16 @@ NAN_METHOD(Map::renderFile) - - render_file_baton_t *closure = new render_file_baton_t(); - -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - delete closure; - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(closure->variables,bind_opt->ToObject()); -+ object_to_container(closure->variables,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - - if (format == "pdf" || format == "svg" || format == "ps" || format == "ARGB32" || format == "RGB24") { -@@ -2582,15 +2589,16 @@ void Map::EIO_RenderFile(uv_work_t* req) - void Map::EIO_AfterRenderFile(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - render_file_baton_t *closure = static_cast(req->data); - closure->m->release(); - - if (closure->error) { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } else { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - - closure->m->Unref(); -@@ -2616,10 +2624,10 @@ NAN_METHOD(Map::renderSync) - return; - } - -- v8::Local options = info[0]->ToObject(); -- if (options->Has(Nan::New("format").ToLocalChecked())) -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("format").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("format").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsString()) { - Nan::ThrowTypeError("'format' must be a String"); - return; -@@ -2628,15 +2636,15 @@ NAN_METHOD(Map::renderSync) - format = TOSTR(format_opt); - } - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; - } - -- v8::Local obj = format_opt->ToObject(); -+ v8::Local obj = format_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Palette::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Palette expected as second arg"); - return; -@@ -2644,32 +2652,32 @@ NAN_METHOD(Map::renderSync) - - palette = Nan::ObjectWrap::Unwrap(obj)->palette(); - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } - -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } - -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } - -- buffer_size = bind_opt->IntegerValue(); -+ buffer_size = Nan::To(bind_opt).FromJust(); - } - } - -@@ -2737,9 +2745,9 @@ NAN_METHOD(Map::renderFileSync) - } - - v8::Local options = info[1].As(); -- if (options->Has(Nan::New("format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("format").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("format").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsString()) { - Nan::ThrowTypeError("'format' must be a String"); - return; -@@ -2748,15 +2756,15 @@ NAN_METHOD(Map::renderFileSync) - format = TOSTR(format_opt); - } - -- if (options->Has(Nan::New("palette").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("palette").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local format_opt = options->Get(Nan::New("palette").ToLocalChecked()); -+ v8::Local format_opt = Nan::Get(options, Nan::New("palette").ToLocalChecked()).ToLocalChecked(); - if (!format_opt->IsObject()) { - Nan::ThrowTypeError("'palette' must be an object"); - return; - } - -- v8::Local obj = format_opt->ToObject(); -+ v8::Local obj = format_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Palette::constructor)->HasInstance(obj)) { - Nan::ThrowTypeError("mapnik.Palette expected as second arg"); - return; -@@ -2764,32 +2772,32 @@ NAN_METHOD(Map::renderFileSync) - - palette = Nan::ObjectWrap::Unwrap(obj)->palette(); - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } - -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } - -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) { -- v8::Local bind_opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) { -+ v8::Local bind_opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } - -- buffer_size = bind_opt->IntegerValue(); -+ buffer_size = Nan::To(bind_opt).FromJust(); - } - } - -diff --git a/src/mapnik_memory_datasource.cpp b/src/mapnik_memory_datasource.cpp -index 3a1c51cd..c40fb4a3 100644 ---- a/src/mapnik_memory_datasource.cpp -+++ b/src/mapnik_memory_datasource.cpp -@@ -30,7 +30,7 @@ void MemoryDatasource::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "add", add); - Nan::SetPrototypeMethod(lcons, "fields", fields); - -- target->Set(Nan::New("MemoryDatasource").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("MemoryDatasource").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -76,23 +76,23 @@ NAN_METHOD(MemoryDatasource::New) - v8::Local options = info[0].As(); - - mapnik::parameters params; -- v8::Local names = options->GetPropertyNames(); -+ v8::Local names = Nan::GetPropertyNames(options).ToLocalChecked(); - unsigned int i = 0; - unsigned int a_length = names->Length(); - while (i < a_length) { -- v8::Local name = names->Get(i)->ToString(); -- v8::Local value = options->Get(name); -+ v8::Local name = Nan::Get(names, i).ToLocalChecked()->ToString(Nan::GetCurrentContext()).ToLocalChecked(); -+ v8::Local value = Nan::Get(options, name).ToLocalChecked(); - if (value->IsUint32() || value->IsInt32()) - { -- params[TOSTR(name)] = value->IntegerValue(); -+ params[TOSTR(name)] = Nan::To(value).FromJust(); - } - else if (value->IsNumber()) - { -- params[TOSTR(name)] = value->NumberValue(); -+ params[TOSTR(name)] = Nan::To(value).FromJust(); - } - else if (value->IsBoolean()) - { -- params[TOSTR(name)] = value->BooleanValue(); -+ params[TOSTR(name)] = Nan::To(value).FromJust(); - } - else - { -@@ -113,7 +113,7 @@ v8::Local MemoryDatasource::NewInstance(mapnik::datasource_ptr ds_ptr - MemoryDatasource* d = new MemoryDatasource(); - d->datasource_ = ds_ptr; - v8::Local ext = Nan::New(d); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new MemoryDatasource instance"); - return scope.Escape(maybe_local.ToLocalChecked()); - } -@@ -158,10 +158,10 @@ NAN_METHOD(MemoryDatasource::featureset) - Nan::ThrowTypeError("optional second argument must be an options object"); - return; - } -- v8::Local options = info[0]->ToObject(); -- if (options->Has(Nan::New("extent").ToLocalChecked())) -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("extent").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local extent_opt = options->Get(Nan::New("extent").ToLocalChecked()); -+ v8::Local extent_opt = Nan::Get(options, Nan::New("extent").ToLocalChecked()).ToLocalChecked(); - if (!extent_opt->IsArray()) - { - Nan::ThrowTypeError("extent value must be an array of [minx,miny,maxx,maxy]"); -@@ -174,17 +174,17 @@ NAN_METHOD(MemoryDatasource::featureset) - Nan::ThrowTypeError("extent value must be an array of [minx,miny,maxx,maxy]"); - return; - } -- v8::Local minx = bbox->Get(0); -- v8::Local miny = bbox->Get(1); -- v8::Local maxx = bbox->Get(2); -- v8::Local maxy = bbox->Get(3); -+ v8::Local minx = Nan::Get(bbox, 0).ToLocalChecked(); -+ v8::Local miny = Nan::Get(bbox, 1).ToLocalChecked(); -+ v8::Local maxx = Nan::Get(bbox, 2).ToLocalChecked(); -+ v8::Local maxy = Nan::Get(bbox, 3).ToLocalChecked(); - if (!minx->IsNumber() || !miny->IsNumber() || !maxx->IsNumber() || !maxy->IsNumber()) - { - Nan::ThrowError("max_extent [minx,miny,maxx,maxy] must be numbers"); - return; - } -- extent = mapnik::box2d(minx->NumberValue(),miny->NumberValue(), -- maxx->NumberValue(),maxy->NumberValue()); -+ extent = mapnik::box2d(Nan::To(minx).FromJust(),Nan::To(miny).FromJust(), -+ Nan::To(maxx).FromJust(),Nan::To(maxy).FromJust()); - } - } - -@@ -226,46 +226,47 @@ NAN_METHOD(MemoryDatasource::add) - - v8::Local obj = info[0].As(); - -- if (obj->Has(Nan::New("wkt").ToLocalChecked()) || (obj->Has(Nan::New("x").ToLocalChecked()) && obj->Has(Nan::New("y").ToLocalChecked()))) -+ if ((Nan::Has(obj, Nan::New("wkt").ToLocalChecked()).FromMaybe(false)) || -+ (Nan::Has(obj, Nan::New("x").ToLocalChecked()).FromMaybe(false) && Nan::Has(obj, Nan::New("y").ToLocalChecked()).FromMaybe(false))) - { -- if (obj->Has(Nan::New("wkt").ToLocalChecked())) -+ if (Nan::Has(obj, Nan::New("wkt").ToLocalChecked()).FromMaybe(false)) - { - Nan::ThrowError("wkt not yet supported"); - return; - } - -- v8::Local x = obj->Get(Nan::New("x").ToLocalChecked()); -- v8::Local y = obj->Get(Nan::New("y").ToLocalChecked()); -+ v8::Local x = Nan::Get(obj, Nan::New("x").ToLocalChecked()).ToLocalChecked(); -+ v8::Local y = Nan::Get(obj, Nan::New("y").ToLocalChecked()).ToLocalChecked(); - if (!x->IsUndefined() && x->IsNumber() && !y->IsUndefined() && y->IsNumber()) - { - mapnik::context_ptr ctx = std::make_shared(); - mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,d->feature_id_)); - ++(d->feature_id_); -- feature->set_geometry(mapnik::geometry::point(x->NumberValue(),y->NumberValue())); -- if (obj->Has(Nan::New("properties").ToLocalChecked())) -+ feature->set_geometry(mapnik::geometry::point(Nan::To(x).FromJust(),Nan::To(y).FromJust())); -+ if (Nan::Has(obj, Nan::New("properties").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local props = obj->Get(Nan::New("properties").ToLocalChecked()); -+ v8::Local props = Nan::Get(obj, Nan::New("properties").ToLocalChecked()).ToLocalChecked(); - if (props->IsObject()) - { -- v8::Local p_obj = props->ToObject(); -- v8::Local names = p_obj->GetPropertyNames(); -+ v8::Local p_obj = props->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ v8::Local names = Nan::GetPropertyNames(p_obj).ToLocalChecked(); - unsigned int i = 0; - unsigned int a_length = names->Length(); - while (i < a_length) - { -- v8::Local name = names->Get(i)->ToString(); -+ v8::Local name = Nan::Get(names, i).ToLocalChecked()->ToString(Nan::GetCurrentContext()).ToLocalChecked(); - // if name in q.property_names() ? -- v8::Local value = p_obj->Get(name); -+ v8::Local value = Nan::Get(p_obj, name).ToLocalChecked(); - if (value->IsString()) { - mapnik::value_unicode_string ustr = d->tr_.transcode(TOSTR(value)); - feature->put_new(TOSTR(name),ustr); - } else if (value->IsNumber()) { -- double num = value->NumberValue(); -+ double num = Nan::To(value).FromJust(); - // todo - round -- if (num == value->IntegerValue()) { -- feature->put_new(TOSTR(name),static_cast(value->IntegerValue())); -+ if (num == Nan::To(value).FromJust()) { -+ feature->put_new(TOSTR(name), Nan::To(value).FromJust()); - } else { -- double dub_val = value->NumberValue(); -+ double dub_val = Nan::To(value).FromJust(); - feature->put_new(TOSTR(name),dub_val); - } - } else if (value->IsNull()) { -diff --git a/src/mapnik_palette.cpp b/src/mapnik_palette.cpp -index 57eafb49..d1fd2b40 100644 ---- a/src/mapnik_palette.cpp -+++ b/src/mapnik_palette.cpp -@@ -20,7 +20,7 @@ void Palette::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "toString", ToString); - Nan::SetPrototypeMethod(lcons, "toBuffer", ToBuffer); - -- target->Set(Nan::New("Palette").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Palette").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -diff --git a/src/mapnik_plugins.hpp b/src/mapnik_plugins.hpp -index 51f72a30..7924cc0b 100644 ---- a/src/mapnik_plugins.hpp -+++ b/src/mapnik_plugins.hpp -@@ -39,7 +39,7 @@ static inline NAN_METHOD(available_input_plugins) - v8::Local a = Nan::New(names.size()); - for (unsigned i = 0; i < names.size(); ++i) - { -- a->Set(i, Nan::New(names[i].c_str()).ToLocalChecked()); -+ Nan::Set(a, i, Nan::New(names[i].c_str()).ToLocalChecked()); - } - info.GetReturnValue().Set(a); - } -diff --git a/src/mapnik_projection.cpp b/src/mapnik_projection.cpp -index e047e2ee..2c36f6bd 100644 ---- a/src/mapnik_projection.cpp -+++ b/src/mapnik_projection.cpp -@@ -35,7 +35,7 @@ void Projection::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "forward", forward); - Nan::SetPrototypeMethod(lcons, "inverse", inverse); - -- target->Set(Nan::New("Projection").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("Projection").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -68,15 +68,15 @@ NAN_METHOD(Projection::New) - return; - } - v8::Local options = info[1].As(); -- if (options->Has(Nan::New("lazy").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("lazy").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local lazy_opt = options->Get(Nan::New("lazy").ToLocalChecked()); -+ v8::Local lazy_opt = Nan::Get(options, Nan::New("lazy").ToLocalChecked()).ToLocalChecked(); - if (!lazy_opt->IsBoolean()) - { - Nan::ThrowTypeError("'lazy' must be a Boolean"); - return; - } -- lazy = lazy_opt->BooleanValue(); -+ lazy = Nan::To(lazy_opt).FromJust(); - } - } - -@@ -125,30 +125,30 @@ NAN_METHOD(Projection::forward) - unsigned int array_length = a->Length(); - if (array_length == 2) - { -- double x = a->Get(0)->NumberValue(); -- double y = a->Get(1)->NumberValue(); -+ double x = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ double y = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); - p->projection_->forward(x,y); - v8::Local arr = Nan::New(2); -- arr->Set(0, Nan::New(x)); -- arr->Set(1, Nan::New(y)); -+ Nan::Set(arr, 0, Nan::New(x)); -+ Nan::Set(arr, 1, Nan::New(y)); - info.GetReturnValue().Set(arr); - } - else if (array_length == 4) - { - double ulx, uly, urx, ury, lrx, lry, llx, lly; -- ulx = llx = a->Get(0)->NumberValue(); -- lry = lly = a->Get(1)->NumberValue(); -- lrx = urx = a->Get(2)->NumberValue(); -- uly = ury = a->Get(3)->NumberValue(); -+ ulx = llx = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ lry = lly = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); -+ lrx = urx = Nan::To(Nan::Get(a, 2).ToLocalChecked()).FromJust(); -+ uly = ury = Nan::To(Nan::Get(a, 3).ToLocalChecked()).FromJust(); - p->projection_->forward(ulx,uly); - p->projection_->forward(urx,ury); - p->projection_->forward(lrx,lry); - p->projection_->forward(llx,lly); - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(std::min(ulx,llx))); -- arr->Set(1, Nan::New(std::min(lry,lly))); -- arr->Set(2, Nan::New(std::max(urx,lrx))); -- arr->Set(3, Nan::New(std::max(ury,uly))); -+ Nan::Set(arr, 0, Nan::New(std::min(ulx,llx))); -+ Nan::Set(arr, 1, Nan::New(std::min(lry,lly))); -+ Nan::Set(arr, 2, Nan::New(std::max(urx,lrx))); -+ Nan::Set(arr, 3, Nan::New(std::max(ury,uly))); - info.GetReturnValue().Set(arr); - } - else -@@ -191,27 +191,27 @@ NAN_METHOD(Projection::inverse) - unsigned int array_length = a->Length(); - if (array_length == 2) - { -- double x = a->Get(0)->NumberValue(); -- double y = a->Get(1)->NumberValue(); -+ double x = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ double y = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); - p->projection_->inverse(x,y); - v8::Local arr = Nan::New(2); -- arr->Set(0, Nan::New(x)); -- arr->Set(1, Nan::New(y)); -+ Nan::Set(arr, 0, Nan::New(x)); -+ Nan::Set(arr, 1, Nan::New(y)); - info.GetReturnValue().Set(arr); - } - else if (array_length == 4) - { -- double minx = a->Get(0)->NumberValue(); -- double miny = a->Get(1)->NumberValue(); -- double maxx = a->Get(2)->NumberValue(); -- double maxy = a->Get(3)->NumberValue(); -+ double minx = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ double miny = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); -+ double maxx = Nan::To(Nan::Get(a, 2).ToLocalChecked()).FromJust(); -+ double maxy = Nan::To(Nan::Get(a, 3).ToLocalChecked()).FromJust(); - p->projection_->inverse(minx,miny); - p->projection_->inverse(maxx,maxy); - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(minx)); -- arr->Set(1, Nan::New(miny)); -- arr->Set(2, Nan::New(maxx)); -- arr->Set(3, Nan::New(maxy)); -+ Nan::Set(arr, 0, Nan::New(minx)); -+ Nan::Set(arr, 1, Nan::New(miny)); -+ Nan::Set(arr, 2, Nan::New(maxx)); -+ Nan::Set(arr, 3, Nan::New(maxy)); - info.GetReturnValue().Set(arr); - } - else -@@ -239,7 +239,7 @@ void ProjTransform::Initialize(v8::Local target) { - Nan::SetPrototypeMethod(lcons, "forward", forward); - Nan::SetPrototypeMethod(lcons, "backward", backward); - -- target->Set(Nan::New("ProjTransform").ToLocalChecked(), lcons->GetFunction()); -+ Nan::Set(target, Nan::New("ProjTransform").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -309,29 +309,29 @@ NAN_METHOD(ProjTransform::forward) - unsigned int array_length = a->Length(); - if (array_length == 2) - { -- double x = a->Get(0)->NumberValue(); -- double y = a->Get(1)->NumberValue(); -+ double x = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ double y = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); - double z = 0; - if (!p->this_->forward(x,y,z)) - { - std::ostringstream s; - s << "Failed to forward project " -- << a->Get(0)->NumberValue() << "," << a->Get(1)->NumberValue() << " from " << p->this_->source().params() << " to " << p->this_->dest().params(); -+ << x << "," << y << " from " << p->this_->source().params() << " to " << p->this_->dest().params(); - Nan::ThrowError(s.str().c_str()); - return; - - } - v8::Local arr = Nan::New(2); -- arr->Set(0, Nan::New(x)); -- arr->Set(1, Nan::New(y)); -+ Nan::Set(arr, 0, Nan::New(x)); -+ Nan::Set(arr, 1, Nan::New(y)); - info.GetReturnValue().Set(arr); - } - else if (array_length == 4) - { -- mapnik::box2d box(a->Get(0)->NumberValue(), -- a->Get(1)->NumberValue(), -- a->Get(2)->NumberValue(), -- a->Get(3)->NumberValue()); -+ mapnik::box2d box(Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 2).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 3).ToLocalChecked()).FromJust()); - if (!p->this_->forward(box)) - { - std::ostringstream s; -@@ -341,10 +341,10 @@ NAN_METHOD(ProjTransform::forward) - return; - } - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(box.minx())); -- arr->Set(1, Nan::New(box.miny())); -- arr->Set(2, Nan::New(box.maxx())); -- arr->Set(3, Nan::New(box.maxy())); -+ Nan::Set(arr, 0, Nan::New(box.minx())); -+ Nan::Set(arr, 1, Nan::New(box.miny())); -+ Nan::Set(arr, 2, Nan::New(box.maxx())); -+ Nan::Set(arr, 3, Nan::New(box.maxy())); - info.GetReturnValue().Set(arr); - } - else -@@ -373,28 +373,28 @@ NAN_METHOD(ProjTransform::backward) - unsigned int array_length = a->Length(); - if (array_length == 2) - { -- double x = a->Get(0)->NumberValue(); -- double y = a->Get(1)->NumberValue(); -+ double x = Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(); -+ double y = Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(); - double z = 0; - if (!p->this_->backward(x,y,z)) - { - std::ostringstream s; - s << "Failed to back project " -- << a->Get(0)->NumberValue() << "," << a->Get(1)->NumberValue() << " from " << p->this_->dest().params() << " to: " << p->this_->source().params(); -+ << x << "," << y << " from " << p->this_->dest().params() << " to: " << p->this_->source().params(); - Nan::ThrowError(s.str().c_str()); - return; - } - v8::Local arr = Nan::New(2); -- arr->Set(0, Nan::New(x)); -- arr->Set(1, Nan::New(y)); -+ Nan::Set(arr, 0, Nan::New(x)); -+ Nan::Set(arr, 1, Nan::New(y)); - info.GetReturnValue().Set(arr); - } - else if (array_length == 4) - { -- mapnik::box2d box(a->Get(0)->NumberValue(), -- a->Get(1)->NumberValue(), -- a->Get(2)->NumberValue(), -- a->Get(3)->NumberValue()); -+ mapnik::box2d box(Nan::To(Nan::Get(a, 0).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 1).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 2).ToLocalChecked()).FromJust(), -+ Nan::To(Nan::Get(a, 3).ToLocalChecked()).FromJust()); - if (!p->this_->backward(box)) - { - std::ostringstream s; -@@ -404,10 +404,10 @@ NAN_METHOD(ProjTransform::backward) - return; - } - v8::Local arr = Nan::New(4); -- arr->Set(0, Nan::New(box.minx())); -- arr->Set(1, Nan::New(box.miny())); -- arr->Set(2, Nan::New(box.maxx())); -- arr->Set(3, Nan::New(box.maxy())); -+ Nan::Set(arr, 0, Nan::New(box.minx())); -+ Nan::Set(arr, 1, Nan::New(box.miny())); -+ Nan::Set(arr, 2, Nan::New(box.maxx())); -+ Nan::Set(arr, 3, Nan::New(box.maxy())); - info.GetReturnValue().Set(arr); - } - else -diff --git a/src/mapnik_vector_tile.cpp b/src/mapnik_vector_tile.cpp -index 15ab6c52..bedd573e 100644 ---- a/src/mapnik_vector_tile.cpp -+++ b/src/mapnik_vector_tile.cpp -@@ -315,9 +315,9 @@ void VectorTile::Initialize(v8::Local target) - ATTR(lcons, "tileSize", get_tile_size, set_tile_size); - ATTR(lcons, "bufferSize", get_buffer_size, set_buffer_size); - -- Nan::SetMethod(lcons->GetFunction().As(), "info", info); -+ Nan::SetMethod(Nan::GetFunction(lcons).ToLocalChecked().As(), "info", info); - -- target->Set(Nan::New("VectorTile").ToLocalChecked(),lcons->GetFunction()); -+ Nan::Set(target, Nan::New("VectorTile").ToLocalChecked(), Nan::GetFunction(lcons).ToLocalChecked()); - constructor.Reset(lcons); - } - -@@ -371,9 +371,9 @@ NAN_METHOD(VectorTile::New) - return; - } - -- std::int64_t z = info[0]->IntegerValue(); -- std::int64_t x = info[1]->IntegerValue(); -- std::int64_t y = info[2]->IntegerValue(); -+ std::int64_t z = Nan::To(info[0]).FromJust(); -+ std::int64_t x = Nan::To(info[1]).FromJust(); -+ std::int64_t y = Nan::To(info[2]).FromJust(); - if (z < 0 || x < 0 || y < 0) - { - Nan::ThrowTypeError("required parameters (z, x, and y) must be greater then or equal to zero"); -@@ -401,16 +401,16 @@ NAN_METHOD(VectorTile::New) - Nan::ThrowTypeError("optional fourth argument must be an options object"); - return; - } -- options = info[3]->ToObject(); -- if (options->Has(Nan::New("tile_size").ToLocalChecked())) -+ options = info[3]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("tile_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("tile_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("tile_size").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'tile_size' must be a number"); - return; - } -- int tile_size_tmp = opt->IntegerValue(); -+ int tile_size_tmp = Nan::To(opt).FromJust(); - if (tile_size_tmp <= 0) - { - Nan::ThrowTypeError("optional arg 'tile_size' must be greater then zero"); -@@ -418,15 +418,15 @@ NAN_METHOD(VectorTile::New) - } - tile_size = tile_size_tmp; - } -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ v8::Local opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } -- buffer_size = opt->IntegerValue(); -+ buffer_size = Nan::To(opt).FromJust(); - } - } - if (static_cast(tile_size) + (2 * buffer_size) <= 0) -@@ -563,81 +563,81 @@ v8::Local VectorTile::_compositeSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("optional second argument must be an options object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("area_threshold").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("area_threshold").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local area_thres = options->Get(Nan::New("area_threshold").ToLocalChecked()); -+ v8::Local area_thres = Nan::Get(options, Nan::New("area_threshold").ToLocalChecked()).ToLocalChecked(); - if (!area_thres->IsNumber()) - { - Nan::ThrowTypeError("option 'area_threshold' must be an floating point number"); - return scope.Escape(Nan::Undefined()); - } -- area_threshold = area_thres->NumberValue(); -+ area_threshold = Nan::To(area_thres).FromJust(); - if (area_threshold < 0.0) - { - Nan::ThrowTypeError("option 'area_threshold' can not be negative"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("simplify_distance").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("simplify_distance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("simplify_distance").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("simplify_distance").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'simplify_distance' must be an floating point number"); - return scope.Escape(Nan::Undefined()); - } -- simplify_distance = param_val->NumberValue(); -+ simplify_distance = Nan::To(param_val).FromJust(); - if (simplify_distance < 0.0) - { - Nan::ThrowTypeError("option 'simplify_distance' can not be negative"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("strictly_simple").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strictly_simple").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local strict_simp = options->Get(Nan::New("strictly_simple").ToLocalChecked()); -+ v8::Local strict_simp = Nan::Get(options, Nan::New("strictly_simple").ToLocalChecked()).ToLocalChecked(); - if (!strict_simp->IsBoolean()) - { - Nan::ThrowTypeError("option 'strictly_simple' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- strictly_simple = strict_simp->BooleanValue(); -+ strictly_simple = Nan::To(strict_simp).FromJust(); - } -- if (options->Has(Nan::New("multi_polygon_union").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("multi_polygon_union").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local mpu = options->Get(Nan::New("multi_polygon_union").ToLocalChecked()); -+ v8::Local mpu = Nan::Get(options, Nan::New("multi_polygon_union").ToLocalChecked()).ToLocalChecked(); - if (!mpu->IsBoolean()) - { - Nan::ThrowTypeError("option 'multi_polygon_union' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- multi_polygon_union = mpu->BooleanValue(); -+ multi_polygon_union = Nan::To(mpu).FromJust(); - } -- if (options->Has(Nan::New("fill_type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fill_type").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local ft = options->Get(Nan::New("fill_type").ToLocalChecked()); -+ v8::Local ft = Nan::Get(options, Nan::New("fill_type").ToLocalChecked()).ToLocalChecked(); - if (!ft->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'fill_type' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- fill_type = static_cast(ft->IntegerValue()); -+ fill_type = static_cast(Nan::To(ft).FromJust()); - if (fill_type < 0 || fill_type >= mapnik::vector_tile_impl::polygon_fill_type_max) - { - Nan::ThrowTypeError("optional arg 'fill_type' out of possible range"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("threading_mode").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("threading_mode").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("threading_mode").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("threading_mode").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'threading_mode' must be an unsigned integer"); - return scope.Escape(Nan::Undefined()); - } -- threading_mode = static_cast(param_val->IntegerValue()); -+ threading_mode = static_cast(Nan::To(param_val).FromJust()); - if (threading_mode != std::launch::async && - threading_mode != std::launch::deferred && - threading_mode != (std::launch::async | std::launch::deferred)) -@@ -646,69 +646,69 @@ v8::Local VectorTile::_compositeSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - if (scale_factor <= 0.0) - { - Nan::ThrowTypeError("optional arg 'scale' must be greater then zero"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - if (scale_denominator < 0.0) - { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be non negative number"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("offset_x").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_x").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_x").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_x' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- offset_x = bind_opt->IntegerValue(); -+ offset_x = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("offset_y").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_y").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_y").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_y' must be a number"); - return scope.Escape(Nan::Undefined()); - } -- offset_y = bind_opt->IntegerValue(); -+ offset_y = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("reencode").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("reencode").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local reencode_opt = options->Get(Nan::New("reencode").ToLocalChecked()); -+ v8::Local reencode_opt = Nan::Get(options, Nan::New("reencode").ToLocalChecked()).ToLocalChecked(); - if (!reencode_opt->IsBoolean()) - { - Nan::ThrowTypeError("reencode value must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- reencode = reencode_opt->BooleanValue(); -+ reencode = Nan::To(reencode_opt).FromJust(); - } -- if (options->Has(Nan::New("max_extent").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_extent").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local max_extent_opt = options->Get(Nan::New("max_extent").ToLocalChecked()); -+ v8::Local max_extent_opt = Nan::Get(options, Nan::New("max_extent").ToLocalChecked()).ToLocalChecked(); - if (!max_extent_opt->IsArray()) - { - Nan::ThrowTypeError("max_extent value must be an array of [minx,miny,maxx,maxy]"); -@@ -721,32 +721,32 @@ v8::Local VectorTile::_compositeSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("max_extent value must be an array of [minx,miny,maxx,maxy]"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local minx = bbox->Get(0); -- v8::Local miny = bbox->Get(1); -- v8::Local maxx = bbox->Get(2); -- v8::Local maxy = bbox->Get(3); -+ v8::Local minx = Nan::Get(bbox, 0).ToLocalChecked(); -+ v8::Local miny = Nan::Get(bbox, 1).ToLocalChecked(); -+ v8::Local maxx = Nan::Get(bbox, 2).ToLocalChecked(); -+ v8::Local maxy = Nan::Get(bbox, 3).ToLocalChecked(); - if (!minx->IsNumber() || !miny->IsNumber() || !maxx->IsNumber() || !maxy->IsNumber()) - { - Nan::ThrowError("max_extent [minx,miny,maxx,maxy] must be numbers"); - return scope.Escape(Nan::Undefined()); - } -- max_extent = mapnik::box2d(minx->NumberValue(),miny->NumberValue(), -- maxx->NumberValue(),maxy->NumberValue()); -+ max_extent = mapnik::box2d(Nan::To(minx).FromJust(),Nan::To(miny).FromJust(), -+ Nan::To(maxx).FromJust(),Nan::To(maxy).FromJust()); - } -- if (options->Has(Nan::New("process_all_rings").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("process_all_rings").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("process_all_rings").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("process_all_rings").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'process_all_rings' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- process_all_rings = param_val->BooleanValue(); -+ process_all_rings = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("image_scaling").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_scaling").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_scaling").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_scaling' must be a string"); -@@ -762,9 +762,9 @@ v8::Local VectorTile::_compositeSync(Nan::NAN_METHOD_ARGS_TYPE info) - scaling_method = *method; - } - -- if (options->Has(Nan::New("image_format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_format").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_format").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_format' must be a string"); -@@ -778,13 +778,13 @@ v8::Local VectorTile::_compositeSync(Nan::NAN_METHOD_ARGS_TYPE info) - vtiles_vec.reserve(num_tiles); - for (unsigned j=0;j < num_tiles;++j) - { -- v8::Local val = vtiles->Get(j); -+ v8::Local val = Nan::Get(vtiles, j).ToLocalChecked(); - if (!val->IsObject()) - { - Nan::ThrowTypeError("must provide an array of VectorTile objects"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local tile_obj = val->ToObject(); -+ v8::Local tile_obj = val->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (tile_obj->IsNull() || tile_obj->IsUndefined() || !Nan::New(VectorTile::constructor)->HasInstance(tile_obj)) - { - Nan::ThrowTypeError("must provide an array of VectorTile objects"); -@@ -952,66 +952,66 @@ NAN_METHOD(VectorTile::composite) - Nan::ThrowTypeError("optional second argument must be an options object"); - return; - } -- v8::Local options = info[1]->ToObject(); -- if (options->Has(Nan::New("area_threshold").ToLocalChecked())) -+ v8::Local options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("area_threshold").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local area_thres = options->Get(Nan::New("area_threshold").ToLocalChecked()); -+ v8::Local area_thres = Nan::Get(options, Nan::New("area_threshold").ToLocalChecked()).ToLocalChecked(); - if (!area_thres->IsNumber()) - { - Nan::ThrowTypeError("option 'area_threshold' must be a number"); - return; - } -- area_threshold = area_thres->NumberValue(); -+ area_threshold = Nan::To(area_thres).FromJust(); - if (area_threshold < 0.0) - { - Nan::ThrowTypeError("option 'area_threshold' can not be negative"); - return; - } - } -- if (options->Has(Nan::New("strictly_simple").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strictly_simple").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local strict_simp = options->Get(Nan::New("strictly_simple").ToLocalChecked()); -+ v8::Local strict_simp = Nan::Get(options, Nan::New("strictly_simple").ToLocalChecked()).ToLocalChecked(); - if (!strict_simp->IsBoolean()) - { - Nan::ThrowTypeError("strictly_simple value must be a boolean"); - return; - } -- strictly_simple = strict_simp->BooleanValue(); -+ strictly_simple = Nan::To(strict_simp).FromJust(); - } -- if (options->Has(Nan::New("multi_polygon_union").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("multi_polygon_union").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local mpu = options->Get(Nan::New("multi_polygon_union").ToLocalChecked()); -+ v8::Local mpu = Nan::Get(options, Nan::New("multi_polygon_union").ToLocalChecked()).ToLocalChecked(); - if (!mpu->IsBoolean()) - { - Nan::ThrowTypeError("multi_polygon_union value must be a boolean"); - return; - } -- multi_polygon_union = mpu->BooleanValue(); -+ multi_polygon_union = Nan::To(mpu).FromJust(); - } -- if (options->Has(Nan::New("fill_type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fill_type").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local ft = options->Get(Nan::New("fill_type").ToLocalChecked()); -+ v8::Local ft = Nan::Get(options, Nan::New("fill_type").ToLocalChecked()).ToLocalChecked(); - if (!ft->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'fill_type' must be a number"); - return; - } -- fill_type = static_cast(ft->IntegerValue()); -+ fill_type = static_cast(Nan::To(ft).FromJust()); - if (fill_type < 0 || fill_type >= mapnik::vector_tile_impl::polygon_fill_type_max) - { - Nan::ThrowTypeError("optional arg 'fill_type' out of possible range"); - return; - } - } -- if (options->Has(Nan::New("threading_mode").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("threading_mode").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("threading_mode").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("threading_mode").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'threading_mode' must be an unsigned integer"); - return; - } -- threading_mode = static_cast(param_val->IntegerValue()); -+ threading_mode = static_cast(Nan::To(param_val).FromJust()); - if (threading_mode != std::launch::async && - threading_mode != std::launch::deferred && - threading_mode != (std::launch::async | std::launch::deferred)) -@@ -1020,84 +1020,84 @@ NAN_METHOD(VectorTile::composite) - return; - } - } -- if (options->Has(Nan::New("simplify_distance").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("simplify_distance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("simplify_distance").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("simplify_distance").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'simplify_distance' must be an floating point number"); - return; - } -- simplify_distance = param_val->NumberValue(); -+ simplify_distance = Nan::To(param_val).FromJust(); - if (simplify_distance < 0.0) - { - Nan::ThrowTypeError("option 'simplify_distance' can not be negative"); - return; - } - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } -- scale_factor = bind_opt->NumberValue(); -+ scale_factor = Nan::To(bind_opt).FromJust(); - if (scale_factor < 0.0) - { - Nan::ThrowTypeError("option 'scale' can not be negative"); - return; - } - } -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } -- scale_denominator = bind_opt->NumberValue(); -+ scale_denominator = Nan::To(bind_opt).FromJust(); - if (scale_denominator < 0.0) - { - Nan::ThrowTypeError("option 'scale_denominator' can not be negative"); - return; - } - } -- if (options->Has(Nan::New("offset_x").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_x").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_x").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_x' must be a number"); - return; - } -- offset_x = bind_opt->IntegerValue(); -+ offset_x = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("offset_y").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("offset_y").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("offset_y").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("offset_y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'offset_y' must be a number"); - return; - } -- offset_y = bind_opt->IntegerValue(); -+ offset_y = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("reencode").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("reencode").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local reencode_opt = options->Get(Nan::New("reencode").ToLocalChecked()); -+ v8::Local reencode_opt = Nan::Get(options, Nan::New("reencode").ToLocalChecked()).ToLocalChecked(); - if (!reencode_opt->IsBoolean()) - { - Nan::ThrowTypeError("reencode value must be a boolean"); - return; - } -- reencode = reencode_opt->BooleanValue(); -+ reencode = Nan::To(reencode_opt).FromJust(); - } -- if (options->Has(Nan::New("max_extent").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("max_extent").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local max_extent_opt = options->Get(Nan::New("max_extent").ToLocalChecked()); -+ v8::Local max_extent_opt = Nan::Get(options, Nan::New("max_extent").ToLocalChecked()).ToLocalChecked(); - if (!max_extent_opt->IsArray()) - { - Nan::ThrowTypeError("max_extent value must be an array of [minx,miny,maxx,maxy]"); -@@ -1110,31 +1110,31 @@ NAN_METHOD(VectorTile::composite) - Nan::ThrowTypeError("max_extent value must be an array of [minx,miny,maxx,maxy]"); - return; - } -- v8::Local minx = bbox->Get(0); -- v8::Local miny = bbox->Get(1); -- v8::Local maxx = bbox->Get(2); -- v8::Local maxy = bbox->Get(3); -+ v8::Local minx = Nan::Get(bbox, 0).ToLocalChecked(); -+ v8::Local miny = Nan::Get(bbox, 1).ToLocalChecked(); -+ v8::Local maxx = Nan::Get(bbox, 2).ToLocalChecked(); -+ v8::Local maxy = Nan::Get(bbox, 3).ToLocalChecked(); - if (!minx->IsNumber() || !miny->IsNumber() || !maxx->IsNumber() || !maxy->IsNumber()) - { - Nan::ThrowError("max_extent [minx,miny,maxx,maxy] must be numbers"); - return; - } -- max_extent = mapnik::box2d(minx->NumberValue(),miny->NumberValue(), -- maxx->NumberValue(),maxy->NumberValue()); -+ max_extent = mapnik::box2d(Nan::To(minx).FromJust(),Nan::To(miny).FromJust(), -+ Nan::To(maxx).FromJust(),Nan::To(maxy).FromJust()); - } -- if (options->Has(Nan::New("process_all_rings").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("process_all_rings").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("process_all_rings").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("process_all_rings").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) { - Nan::ThrowTypeError("option 'process_all_rings' must be a boolean"); - return; - } -- process_all_rings = param_val->BooleanValue(); -+ process_all_rings = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("image_scaling").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_scaling").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_scaling").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_scaling' must be a string"); -@@ -1150,9 +1150,9 @@ NAN_METHOD(VectorTile::composite) - scaling_method = *method; - } - -- if (options->Has(Nan::New("image_format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_format").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_format").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_format' must be a string"); -@@ -1185,14 +1185,14 @@ NAN_METHOD(VectorTile::composite) - closure->vtiles.reserve(num_tiles); - for (unsigned j=0;j < num_tiles;++j) - { -- v8::Local val = vtiles->Get(j); -+ v8::Local val = Nan::Get(vtiles, j).ToLocalChecked(); - if (!val->IsObject()) - { - delete closure; - Nan::ThrowTypeError("must provide an array of VectorTile objects"); - return; - } -- v8::Local tile_obj = val->ToObject(); -+ v8::Local tile_obj = val->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (tile_obj->IsNull() || tile_obj->IsUndefined() || !Nan::New(VectorTile::constructor)->HasInstance(tile_obj)) - { - delete closure; -@@ -1242,17 +1242,18 @@ void VectorTile::EIO_Composite(uv_work_t* req) - void VectorTile::EIO_AfterComposite(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_composite_baton_t *closure = static_cast(req->data); - - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[2] = { Nan::Null(), closure->d->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - for (VectorTile* vt : closure->vtiles) - { -@@ -1280,10 +1281,10 @@ NAN_METHOD(VectorTile::extent) - VectorTile* d = Nan::ObjectWrap::Unwrap(info.Holder()); - v8::Local arr = Nan::New(4); - mapnik::box2d const& e = d->tile_->extent(); -- arr->Set(0, Nan::New(e.minx())); -- arr->Set(1, Nan::New(e.miny())); -- arr->Set(2, Nan::New(e.maxx())); -- arr->Set(3, Nan::New(e.maxy())); -+ Nan::Set(arr, 0, Nan::New(e.minx())); -+ Nan::Set(arr, 1, Nan::New(e.miny())); -+ Nan::Set(arr, 2, Nan::New(e.maxx())); -+ Nan::Set(arr, 3, Nan::New(e.maxy())); - info.GetReturnValue().Set(arr); - return; - } -@@ -1305,10 +1306,10 @@ NAN_METHOD(VectorTile::bufferedExtent) - VectorTile* d = Nan::ObjectWrap::Unwrap(info.Holder()); - v8::Local arr = Nan::New(4); - mapnik::box2d e = d->tile_->get_buffered_extent(); -- arr->Set(0, Nan::New(e.minx())); -- arr->Set(1, Nan::New(e.miny())); -- arr->Set(2, Nan::New(e.maxx())); -- arr->Set(3, Nan::New(e.maxy())); -+ Nan::Set(arr, 0, Nan::New(e.minx())); -+ Nan::Set(arr, 1, Nan::New(e.miny())); -+ Nan::Set(arr, 2, Nan::New(e.maxx())); -+ Nan::Set(arr, 3, Nan::New(e.maxy())); - info.GetReturnValue().Set(arr); - return; - } -@@ -1334,7 +1335,7 @@ NAN_METHOD(VectorTile::names) - unsigned idx = 0; - for (std::string const& name : names) - { -- arr->Set(idx++,Nan::New(name).ToLocalChecked()); -+ Nan::Set(arr, idx++,Nan::New(name).ToLocalChecked()); - } - info.GetReturnValue().Set(arr); - return; -@@ -1396,7 +1397,7 @@ NAN_METHOD(VectorTile::layer) - } - } - v8::Local ext = Nan::New(v); -- Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); -+ Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::GetFunction(Nan::New(constructor)).ToLocalChecked(), 1, &ext); - if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Layer instance"); - else info.GetReturnValue().Set(maybe_local.ToLocalChecked()); - return; -@@ -1423,7 +1424,7 @@ NAN_METHOD(VectorTile::emptyLayers) - unsigned idx = 0; - for (std::string const& name : names) - { -- arr->Set(idx++,Nan::New(name).ToLocalChecked()); -+ Nan::Set(arr, idx++,Nan::New(name).ToLocalChecked()); - } - info.GetReturnValue().Set(arr); - return; -@@ -1451,7 +1452,7 @@ NAN_METHOD(VectorTile::paintedLayers) - unsigned idx = 0; - for (std::string const& name : names) - { -- arr->Set(idx++,Nan::New(name).ToLocalChecked()); -+ Nan::Set(arr, idx++,Nan::New(name).ToLocalChecked()); - } - info.GetReturnValue().Set(arr); - return; -@@ -1576,20 +1577,20 @@ NAN_METHOD(VectorTile::query) - Nan::ThrowTypeError("optional third argument must be an options object"); - return; - } -- options = info[2]->ToObject(); -- if (options->Has(Nan::New("tolerance").ToLocalChecked())) -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("tolerance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local tol = options->Get(Nan::New("tolerance").ToLocalChecked()); -+ v8::Local tol = Nan::Get(options, Nan::New("tolerance").ToLocalChecked()).ToLocalChecked(); - if (!tol->IsNumber()) - { - Nan::ThrowTypeError("tolerance value must be a number"); - return; - } -- tolerance = tol->NumberValue(); -+ tolerance = Nan::To(tol).FromJust(); - } -- if (options->Has(Nan::New("layer").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("layer").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local layer_id = options->Get(Nan::New("layer").ToLocalChecked()); -+ v8::Local layer_id = Nan::Get(options, Nan::New("layer").ToLocalChecked()).ToLocalChecked(); - if (!layer_id->IsString()) - { - Nan::ThrowTypeError("layer value must be a string"); -@@ -1599,8 +1600,8 @@ NAN_METHOD(VectorTile::query) - } - } - -- double lon = info[0]->NumberValue(); -- double lat = info[1]->NumberValue(); -+ double lon = Nan::To(info[0]).FromJust(); -+ double lat = Nan::To(info[1]).FromJust(); - VectorTile* d = Nan::ObjectWrap::Unwrap(info.Holder()); - - // If last argument is not a function go with sync call. -@@ -1654,18 +1655,19 @@ void VectorTile::EIO_Query(uv_work_t* req) - void VectorTile::EIO_AfterQuery(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_query_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - std::vector const& result = closure->result; - v8::Local arr = _queryResultToV8(result); - v8::Local argv[2] = { Nan::Null(), arr }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->d->Unref(); -@@ -1790,12 +1792,12 @@ v8::Local VectorTile::_queryResultToV8(std::vector cons - for (auto const& item : result) - { - v8::Local feat = Feature::NewInstance(item.feature); -- v8::Local feat_obj = feat->ToObject(); -- feat_obj->Set(Nan::New("layer").ToLocalChecked(),Nan::New(item.layer).ToLocalChecked()); -- feat_obj->Set(Nan::New("distance").ToLocalChecked(),Nan::New(item.distance)); -- feat_obj->Set(Nan::New("x_hit").ToLocalChecked(),Nan::New(item.x_hit)); -- feat_obj->Set(Nan::New("y_hit").ToLocalChecked(),Nan::New(item.y_hit)); -- arr->Set(i++,feat); -+ v8::Local feat_obj = feat->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ Nan::Set(feat_obj, Nan::New("layer").ToLocalChecked(),Nan::New(item.layer).ToLocalChecked()); -+ Nan::Set(feat_obj, Nan::New("distance").ToLocalChecked(),Nan::New(item.distance)); -+ Nan::Set(feat_obj, Nan::New("x_hit").ToLocalChecked(),Nan::New(item.x_hit)); -+ Nan::Set(feat_obj, Nan::New("y_hit").ToLocalChecked(),Nan::New(item.y_hit)); -+ Nan::Set(arr, i++,feat); - } - return arr; - } -@@ -1864,23 +1866,23 @@ NAN_METHOD(VectorTile::queryMany) - query.reserve(queryArray->Length()); - for (uint32_t p = 0; p < queryArray->Length(); ++p) - { -- v8::Local item = queryArray->Get(p); -+ v8::Local item = Nan::Get(queryArray, p).ToLocalChecked(); - if (!item->IsArray()) - { - Nan::ThrowError("non-array item encountered"); - return; - } - v8::Local pair = v8::Local::Cast(item); -- v8::Local lon = pair->Get(0); -- v8::Local lat = pair->Get(1); -+ v8::Local lon = Nan::Get(pair, 0).ToLocalChecked(); -+ v8::Local lat = Nan::Get(pair, 1).ToLocalChecked(); - if (!lon->IsNumber() || !lat->IsNumber()) - { - Nan::ThrowError("lng lat must be numbers"); - return; - } - query_lonlat lonlat; -- lonlat.lon = lon->NumberValue(); -- lonlat.lat = lat->NumberValue(); -+ lonlat.lon = Nan::To(lon).FromJust(); -+ lonlat.lat = Nan::To(lat).FromJust(); - query.push_back(std::move(lonlat)); - } - -@@ -1893,20 +1895,20 @@ NAN_METHOD(VectorTile::queryMany) - Nan::ThrowTypeError("optional second argument must be an options object"); - return; - } -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("tolerance").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("tolerance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local tol = options->Get(Nan::New("tolerance").ToLocalChecked()); -+ v8::Local tol = Nan::Get(options, Nan::New("tolerance").ToLocalChecked()).ToLocalChecked(); - if (!tol->IsNumber()) - { - Nan::ThrowTypeError("tolerance value must be a number"); - return; - } -- tolerance = tol->NumberValue(); -+ tolerance = Nan::To(tol).FromJust(); - } -- if (options->Has(Nan::New("layer").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("layer").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local layer_id = options->Get(Nan::New("layer").ToLocalChecked()); -+ v8::Local layer_id = Nan::Get(options, Nan::New("layer").ToLocalChecked()).ToLocalChecked(); - if (!layer_id->IsString()) - { - Nan::ThrowTypeError("layer value must be a string"); -@@ -1914,9 +1916,9 @@ NAN_METHOD(VectorTile::queryMany) - } - layer_name = TOSTR(layer_id); - } -- if (options->Has(Nan::New("fields").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fields").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("fields").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("fields").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsArray()) - { - Nan::ThrowTypeError("option 'fields' must be an array of strings"); -@@ -1928,7 +1930,7 @@ NAN_METHOD(VectorTile::queryMany) - fields.reserve(num_fields); - while (i < num_fields) - { -- v8::Local name = a->Get(i); -+ v8::Local name = Nan::Get(a, i).ToLocalChecked(); - if (name->IsString()) - { - fields.emplace_back(TOSTR(name)); -@@ -2115,16 +2117,16 @@ v8::Local VectorTile::_queryManyResultToV8(queryMany_result const& r - v8::Local results = Nan::New(); - v8::Local features = Nan::New(result.features.size()); - v8::Local hits = Nan::New(result.hits.size()); -- results->Set(Nan::New("hits").ToLocalChecked(), hits); -- results->Set(Nan::New("features").ToLocalChecked(), features); -+ Nan::Set(results, Nan::New("hits").ToLocalChecked(), hits); -+ Nan::Set(results, Nan::New("features").ToLocalChecked(), features); - - // result.features => features - for (auto const& item : result.features) - { - v8::Local feat = Feature::NewInstance(item.second.feature); -- v8::Local feat_obj = feat->ToObject(); -- feat_obj->Set(Nan::New("layer").ToLocalChecked(),Nan::New(item.second.layer).ToLocalChecked()); -- features->Set(item.first, feat_obj); -+ v8::Local feat_obj = feat->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ Nan::Set(feat_obj, Nan::New("layer").ToLocalChecked(),Nan::New(item.second.layer).ToLocalChecked()); -+ Nan::Set(features, item.first, feat_obj); - } - - // result.hits => hits -@@ -2135,11 +2137,11 @@ v8::Local VectorTile::_queryManyResultToV8(queryMany_result const& r - for (auto const& h : hit.second) - { - v8::Local hit_obj = Nan::New(); -- hit_obj->Set(Nan::New("distance").ToLocalChecked(), Nan::New(h.distance)); -- hit_obj->Set(Nan::New("feature_id").ToLocalChecked(), Nan::New(h.feature_id)); -- point_hits->Set(i++, hit_obj); -+ Nan::Set(hit_obj, Nan::New("distance").ToLocalChecked(), Nan::New(h.distance)); -+ Nan::Set(hit_obj, Nan::New("feature_id").ToLocalChecked(), Nan::New(h.feature_id)); -+ Nan::Set(point_hits, i++, hit_obj); - } -- hits->Set(hit.first, point_hits); -+ Nan::Set(hits, hit.first, point_hits); - } - - return results; -@@ -2162,18 +2164,19 @@ void VectorTile::EIO_QueryMany(uv_work_t* req) - void VectorTile::EIO_AfterQueryMany(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_queryMany_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - queryMany_result result = closure->result; - v8::Local obj = _queryManyResultToV8(result); - v8::Local argv[2] = { Nan::Null(), obj }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - - closure->d->Unref(); -@@ -2264,8 +2267,8 @@ struct geometry_array_visitor - { - Nan::EscapableHandleScope scope; - v8::Local arr = Nan::New(2); -- arr->Set(0, Nan::New(geom.x)); -- arr->Set(1, Nan::New(geom.y)); -+ Nan::Set(arr, 0, Nan::New(geom.x)); -+ Nan::Set(arr, 1, Nan::New(geom.y)); - return scope.Escape(arr); - } - -@@ -2285,7 +2288,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2306,7 +2309,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2327,7 +2330,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2348,7 +2351,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2367,10 +2370,10 @@ struct geometry_array_visitor - } - v8::Local arr = Nan::New(1 + geom.interior_rings.size()); - std::uint32_t c = 0; -- arr->Set(c++, (*this)(geom.exterior_ring)); -+ Nan::Set(arr, c++, (*this)(geom.exterior_ring)); - for (auto const & pt : geom.interior_rings) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2391,7 +2394,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - } -@@ -2422,7 +2425,7 @@ struct geometry_array_visitor - std::uint32_t c = 0; - for (auto const & pt : geom) - { -- arr->Set(c++, (*this)(pt)); -+ Nan::Set(arr, c++, (*this)(pt)); - } - return scope.Escape(arr); - // LCOV_EXCL_STOP -@@ -2448,34 +2451,34 @@ struct json_value_visitor - - void operator() (std::string const& val) - { -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val).ToLocalChecked()); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val).ToLocalChecked()); - } - - void operator() (bool const& val) - { -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val)); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val)); - } - - void operator() (int64_t const& val) - { -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val)); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val)); - } - - void operator() (uint64_t const& val) - { - // LCOV_EXCL_START -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val)); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val)); - // LCOV_EXCL_STOP - } - - void operator() (double const& val) - { -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val)); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val)); - } - - void operator() (float const& val) - { -- att_obj_->Set(Nan::New(name_).ToLocalChecked(), Nan::New(val)); -+ Nan::Set(att_obj_, Nan::New(name_).ToLocalChecked(), Nan::New(val)); - } - }; - -@@ -2513,17 +2516,17 @@ NAN_METHOD(VectorTile::toJSON) - Nan::ThrowError("The first argument must be an object"); - return; - } -- v8::Local options = info[0]->ToObject(); -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("decode_geometry").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("decode_geometry").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("decode_geometry").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("decode_geometry").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'decode_geometry' must be a boolean"); - return; - } -- decode_geometry = param_val->BooleanValue(); -+ decode_geometry = Nan::To(param_val).FromJust(); - } - } - -@@ -2547,7 +2550,7 @@ NAN_METHOD(VectorTile::toJSON) - switch (layer_msg.tag()) - { - case mapnik::vector_tile_impl::Layer_Encoding::NAME: -- layer_obj->Set(Nan::New("name").ToLocalChecked(), Nan::New(layer_msg.get_string()).ToLocalChecked()); -+ Nan::Set(layer_obj, Nan::New("name").ToLocalChecked(), Nan::New(layer_msg.get_string()).ToLocalChecked()); - break; - case mapnik::vector_tile_impl::Layer_Encoding::FEATURES: - layer_features.push_back(layer_msg.get_message()); -@@ -2595,11 +2598,11 @@ NAN_METHOD(VectorTile::toJSON) - } - break; - case mapnik::vector_tile_impl::Layer_Encoding::EXTENT: -- layer_obj->Set(Nan::New("extent").ToLocalChecked(), Nan::New(layer_msg.get_uint32())); -+ Nan::Set(layer_obj, Nan::New("extent").ToLocalChecked(), Nan::New(layer_msg.get_uint32())); - break; - case mapnik::vector_tile_impl::Layer_Encoding::VERSION: - version = layer_msg.get_uint32(); -- layer_obj->Set(Nan::New("version").ToLocalChecked(), Nan::New(version)); -+ Nan::Set(layer_obj, Nan::New("version").ToLocalChecked(), Nan::New(version)); - break; - default: - // LCOV_EXCL_START -@@ -2624,7 +2627,7 @@ NAN_METHOD(VectorTile::toJSON) - switch (feature_msg.tag()) - { - case mapnik::vector_tile_impl::Feature_Encoding::ID: -- feature_obj->Set(Nan::New("id").ToLocalChecked(),Nan::New(feature_msg.get_uint64())); -+ Nan::Set(feature_obj, Nan::New("id").ToLocalChecked(),Nan::New(feature_msg.get_uint64())); - break; - case mapnik::vector_tile_impl::Feature_Encoding::TAGS: - tag_itr = feature_msg.get_packed_uint32(); -@@ -2633,7 +2636,7 @@ NAN_METHOD(VectorTile::toJSON) - case mapnik::vector_tile_impl::Feature_Encoding::TYPE: - geom_type_enum = feature_msg.get_enum(); - has_geom_type = true; -- feature_obj->Set(Nan::New("type").ToLocalChecked(),Nan::New(geom_type_enum)); -+ Nan::Set(feature_obj, Nan::New("type").ToLocalChecked(),Nan::New(geom_type_enum)); - break; - case mapnik::vector_tile_impl::Feature_Encoding::GEOMETRY: - geom_itr = feature_msg.get_packed_uint32(); -@@ -2642,7 +2645,7 @@ NAN_METHOD(VectorTile::toJSON) - case mapnik::vector_tile_impl::Feature_Encoding::RASTER: - { - auto im_buffer = feature_msg.get_view(); -- feature_obj->Set(Nan::New("raster").ToLocalChecked(), -+ Nan::Set(feature_obj, Nan::New("raster").ToLocalChecked(), - Nan::CopyBuffer(im_buffer.data(), im_buffer.size()).ToLocalChecked()); - break; - } -@@ -2674,7 +2677,7 @@ NAN_METHOD(VectorTile::toJSON) - } - } - } -- feature_obj->Set(Nan::New("properties").ToLocalChecked(),att_obj); -+ Nan::Set(feature_obj, Nan::New("properties").ToLocalChecked(), att_obj); - if (has_geom && has_geom_type) - { - if (decode_geometry) -@@ -2683,9 +2686,9 @@ NAN_METHOD(VectorTile::toJSON) - mapnik::vector_tile_impl::GeometryPBF geoms(geom_itr); - mapnik::geometry::geometry geom = mapnik::vector_tile_impl::decode_geometry(geoms, geom_type_enum, version, 0, 0, 1.0, 1.0); - v8::Local g_arr = geometry_to_array(geom); -- feature_obj->Set(Nan::New("geometry").ToLocalChecked(),g_arr); -+ Nan::Set(feature_obj, Nan::New("geometry").ToLocalChecked(), g_arr); - std::string geom_type = geometry_type_as_string(geom); -- feature_obj->Set(Nan::New("geometry_type").ToLocalChecked(),Nan::New(geom_type).ToLocalChecked()); -+ Nan::Set(feature_obj, Nan::New("geometry_type").ToLocalChecked(), Nan::New(geom_type).ToLocalChecked()); - } - else - { -@@ -2697,15 +2700,15 @@ NAN_METHOD(VectorTile::toJSON) - v8::Local g_arr = Nan::New(geom_vec.size()); - for (std::size_t k = 0; k < geom_vec.size();++k) - { -- g_arr->Set(k,Nan::New(geom_vec[k])); -+ Nan::Set(g_arr, k, Nan::New(geom_vec[k])); - } -- feature_obj->Set(Nan::New("geometry").ToLocalChecked(),g_arr); -+ Nan::Set(feature_obj, Nan::New("geometry").ToLocalChecked(), g_arr); - } - } -- f_arr->Set(f_idx++,feature_obj); -+ Nan::Set(f_arr, f_idx++, feature_obj); - } -- layer_obj->Set(Nan::New("features").ToLocalChecked(), f_arr); -- arr->Set(l_idx++, layer_obj); -+ Nan::Set(layer_obj, Nan::New("features").ToLocalChecked(), f_arr); -+ Nan::Set(arr, l_idx++, layer_obj); - } - info.GetReturnValue().Set(arr); - return; -@@ -2952,7 +2955,7 @@ v8::Local VectorTile::_toGeoJSONSync(Nan::NAN_METHOD_ARGS_TYPE info) - } - else if (layer_id->IsNumber()) - { -- int layer_idx = layer_id->IntegerValue(); -+ int layer_idx = Nan::To(layer_id).FromJust(); - if (layer_idx < 0) - { - Nan::ThrowTypeError("A layer index can not be negative"); -@@ -3069,7 +3072,7 @@ NAN_METHOD(VectorTile::toGeoJSON) - } - else if (layer_id->IsNumber()) - { -- closure->layer_idx = layer_id->IntegerValue(); -+ closure->layer_idx = Nan::To(layer_id).FromJust(); - if (closure->layer_idx < 0) - { - delete closure; -@@ -3128,6 +3131,7 @@ void VectorTile::to_geojson(uv_work_t* req) - void VectorTile::after_to_geojson(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - to_geojson_baton *closure = static_cast(req->data); - if (closure->error) - { -@@ -3135,13 +3139,13 @@ void VectorTile::after_to_geojson(uv_work_t* req) - // there is no easy way to test this path currently - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->result.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::New(closure->result).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->v->Unref(); - closure->cb.Reset(); -@@ -3213,81 +3217,81 @@ NAN_METHOD(VectorTile::addGeoJSON) - return; - } - -- options = info[2]->ToObject(); -- if (options->Has(Nan::New("area_threshold").ToLocalChecked())) -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("area_threshold").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("area_threshold").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("area_threshold").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowError("option 'area_threshold' must be a number"); - return; - } -- area_threshold = param_val->IntegerValue(); -+ area_threshold = Nan::To(param_val).FromJust(); - if (area_threshold < 0.0) - { - Nan::ThrowError("option 'area_threshold' can not be negative"); - return; - } - } -- if (options->Has(Nan::New("strictly_simple").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strictly_simple").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("strictly_simple").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("strictly_simple").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'strictly_simple' must be a boolean"); - return; - } -- strictly_simple = param_val->BooleanValue(); -+ strictly_simple = Nan::To(param_val).FromJust(); - } -- if (options->Has(Nan::New("multi_polygon_union").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("multi_polygon_union").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local mpu = options->Get(Nan::New("multi_polygon_union").ToLocalChecked()); -+ v8::Local mpu = Nan::Get(options, Nan::New("multi_polygon_union").ToLocalChecked()).ToLocalChecked(); - if (!mpu->IsBoolean()) - { - Nan::ThrowTypeError("multi_polygon_union value must be a boolean"); - return; - } -- multi_polygon_union = mpu->BooleanValue(); -+ multi_polygon_union = Nan::To(mpu).FromJust(); - } -- if (options->Has(Nan::New("fill_type").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fill_type").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local ft = options->Get(Nan::New("fill_type").ToLocalChecked()); -+ v8::Local ft = Nan::Get(options, Nan::New("fill_type").ToLocalChecked()).ToLocalChecked(); - if (!ft->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'fill_type' must be a number"); - return; - } -- fill_type = static_cast(ft->IntegerValue()); -+ fill_type = static_cast(Nan::To(ft).FromJust()); - if (fill_type < 0 || fill_type >= mapnik::vector_tile_impl::polygon_fill_type_max) - { - Nan::ThrowTypeError("optional arg 'fill_type' out of possible range"); - return; - } - } -- if (options->Has(Nan::New("simplify_distance").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("simplify_distance").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("simplify_distance").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("simplify_distance").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'simplify_distance' must be an floating point number"); - return; - } -- simplify_distance = param_val->NumberValue(); -+ simplify_distance = Nan::To(param_val).FromJust(); - if (simplify_distance < 0.0) - { - Nan::ThrowTypeError("option 'simplify_distance' must be a positive number"); - return; - } - } -- if (options->Has(Nan::New("process_all_rings").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("process_all_rings").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("process_all_rings").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("process_all_rings").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'process_all_rings' must be a boolean"); - return; - } -- process_all_rings = param_val->BooleanValue(); -+ process_all_rings = Nan::To(param_val).FromJust(); - } - } - -@@ -3361,7 +3365,7 @@ v8::Local VectorTile::_addImageSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - std::string layer_name = TOSTR(info[1]); -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || - obj->IsUndefined() || - !Nan::New(Image::constructor)->HasInstance(obj)) -@@ -3388,10 +3392,10 @@ v8::Local VectorTile::_addImageSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - -- v8::Local options = info[2]->ToObject(); -- if (options->Has(Nan::New("image_scaling").ToLocalChecked())) -+ v8::Local options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("image_scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_scaling").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_scaling").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_scaling' must be a string"); -@@ -3407,9 +3411,9 @@ v8::Local VectorTile::_addImageSync(Nan::NAN_METHOD_ARGS_TYPE info) - scaling_method = *method; - } - -- if (options->Has(Nan::New("image_format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_format").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_format").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_format' must be a string"); -@@ -3513,7 +3517,7 @@ NAN_METHOD(VectorTile::addImage) - return; - } - std::string layer_name = TOSTR(info[1]); -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || - obj->IsUndefined() || - !Nan::New(Image::constructor)->HasInstance(obj)) -@@ -3540,10 +3544,10 @@ NAN_METHOD(VectorTile::addImage) - return; - } - -- v8::Local options = info[2]->ToObject(); -- if (options->Has(Nan::New("image_scaling").ToLocalChecked())) -+ v8::Local options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("image_scaling").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_scaling").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_scaling").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_scaling' must be a string"); -@@ -3559,9 +3563,9 @@ NAN_METHOD(VectorTile::addImage) - scaling_method = *method; - } - -- if (options->Has(Nan::New("image_format").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("image_format").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("image_format").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("image_format").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'image_format' must be a string"); -@@ -3621,16 +3625,17 @@ void VectorTile::EIO_AddImage(uv_work_t* req) - void VectorTile::EIO_AfterAddImage(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_add_image_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - - closure->d->Unref(); -@@ -3674,7 +3679,7 @@ v8::Local VectorTile::_addImageBufferSync(Nan::NAN_METHOD_ARGS_TYPE i - return scope.Escape(Nan::Undefined()); - } - std::string layer_name = TOSTR(info[1]); -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -3762,7 +3767,7 @@ NAN_METHOD(VectorTile::addImageBuffer) - return; - } - std::string layer_name = TOSTR(info[1]); -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -3805,18 +3810,19 @@ void VectorTile::EIO_AddImageBuffer(uv_work_t* req) - void VectorTile::EIO_AfterAddImageBuffer(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_addimagebuffer_baton_t *closure = static_cast(req->data); - if (closure->error) - { - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - - closure->d->Unref(); -@@ -3856,7 +3862,7 @@ v8::Local VectorTile::_addDataSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("first argument must be a buffer object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -3878,26 +3884,26 @@ v8::Local VectorTile::_addDataSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("second arg must be a options object"); - return scope.Escape(Nan::Undefined()); - } -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("validate").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("validate").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("validate").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("validate").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'validate' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- validate = param_val->BooleanValue(); -+ validate = Nan::To(param_val).FromJust(); - } -- if (options->Has(Nan::New("upgrade").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("upgrade").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("upgrade").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("upgrade").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'upgrade' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- upgrade = param_val->BooleanValue(); -+ upgrade = Nan::To(param_val).FromJust(); - } - } - try -@@ -3962,7 +3968,7 @@ NAN_METHOD(VectorTile::addData) - Nan::ThrowTypeError("first argument must be a buffer object"); - return; - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -3979,26 +3985,26 @@ NAN_METHOD(VectorTile::addData) - Nan::ThrowTypeError("second arg must be a options object"); - return; - } -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("validate").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("validate").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("validate").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("validate").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'validate' must be a boolean"); - return; - } -- validate = param_val->BooleanValue(); -+ validate = Nan::To(param_val).FromJust(); - } -- if (options->Has(Nan::New("upgrade").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("upgrade").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("upgrade").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("upgrade").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'upgrade' must be a boolean"); - return; - } -- upgrade = param_val->BooleanValue(); -+ upgrade = Nan::To(param_val).FromJust(); - } - } - -@@ -4043,16 +4049,17 @@ void VectorTile::EIO_AddData(uv_work_t* req) - void VectorTile::EIO_AfterAddData(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_adddata_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - - closure->d->Unref(); -@@ -4092,7 +4099,7 @@ v8::Local VectorTile::_setDataSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("first argument must be a buffer object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -4114,26 +4121,26 @@ v8::Local VectorTile::_setDataSync(Nan::NAN_METHOD_ARGS_TYPE info) - Nan::ThrowTypeError("second arg must be a options object"); - return scope.Escape(Nan::Undefined()); - } -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("validate").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("validate").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("validate").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("validate").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'validate' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- validate = param_val->BooleanValue(); -+ validate = Nan::To(param_val).FromJust(); - } -- if (options->Has(Nan::New("upgrade").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("upgrade").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("upgrade").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("upgrade").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'upgrade' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- upgrade = param_val->BooleanValue(); -+ upgrade = Nan::To(param_val).FromJust(); - } - } - try -@@ -4198,7 +4205,7 @@ NAN_METHOD(VectorTile::setData) - Nan::ThrowTypeError("first argument must be a buffer object"); - return; - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first arg must be a buffer object"); -@@ -4215,26 +4222,26 @@ NAN_METHOD(VectorTile::setData) - Nan::ThrowTypeError("second arg must be a options object"); - return; - } -- options = info[1]->ToObject(); -- if (options->Has(Nan::New("validate").ToLocalChecked())) -+ options = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("validate").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("validate").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("validate").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'validate' must be a boolean"); - return; - } -- validate = param_val->BooleanValue(); -+ validate = Nan::To(param_val).FromJust(); - } -- if (options->Has(Nan::New("upgrade").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("upgrade").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("upgrade").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("upgrade").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowTypeError("option 'upgrade' must be a boolean"); - return; - } -- upgrade = param_val->BooleanValue(); -+ upgrade = Nan::To(param_val).FromJust(); - } - } - -@@ -4281,16 +4288,17 @@ void VectorTile::EIO_SetData(uv_work_t* req) - void VectorTile::EIO_AfterSetData(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_setdata_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - - closure->d->Unref(); -@@ -4341,59 +4349,59 @@ v8::Local VectorTile::_getDataSync(Nan::NAN_METHOD_ARGS_TYPE info) - return scope.Escape(Nan::Undefined()); - } - -- options = info[0]->ToObject(); -+ options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("compression").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("compression").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("compression").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("compression").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'compression' must be a string, either 'gzip', or 'none' (default)"); - return scope.Escape(Nan::Undefined()); - } -- compress = std::string("gzip") == (TOSTR(param_val->ToString())); -+ compress = std::string("gzip") == (TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())); - } - -- if (options->Has(Nan::New("level").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("level").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("level").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("level").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive"); - return scope.Escape(Nan::Undefined()); - } -- level = param_val->IntegerValue(); -+ level = Nan::To(param_val).FromJust(); - if (level < 0 || level > 9) - { - Nan::ThrowTypeError("option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive"); - return scope.Escape(Nan::Undefined()); - } - } -- if (options->Has(Nan::New("strategy").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strategy").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("strategy").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("strategy").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT"); - return scope.Escape(Nan::Undefined()); - } -- else if (std::string("FILTERED") == TOSTR(param_val->ToString())) -+ else if (std::string("FILTERED") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_FILTERED; - } -- else if (std::string("HUFFMAN_ONLY") == TOSTR(param_val->ToString())) -+ else if (std::string("HUFFMAN_ONLY") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_HUFFMAN_ONLY; - } -- else if (std::string("RLE") == TOSTR(param_val->ToString())) -+ else if (std::string("RLE") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_RLE; - } -- else if (std::string("FIXED") == TOSTR(param_val->ToString())) -+ else if (std::string("FIXED") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_FIXED; - } -- else if (std::string("DEFAULT") == TOSTR(param_val->ToString())) -+ else if (std::string("DEFAULT") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_DEFAULT_STRATEGY; - } -@@ -4506,59 +4514,59 @@ NAN_METHOD(VectorTile::getData) - return; - } - -- options = info[0]->ToObject(); -+ options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("compression").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("compression").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("compression").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("compression").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'compression' must be a string, either 'gzip', or 'none' (default)"); - return; - } -- compress = std::string("gzip") == (TOSTR(param_val->ToString())); -+ compress = std::string("gzip") == (TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())); - } - -- if (options->Has(Nan::New("level").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("level").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("level").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("level").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsNumber()) - { - Nan::ThrowTypeError("option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive"); - return; - } -- level = param_val->IntegerValue(); -+ level = Nan::To(param_val).FromJust(); - if (level < 0 || level > 9) - { - Nan::ThrowTypeError("option 'level' must be an integer between 0 (no compression) and 9 (best compression) inclusive"); - return; - } - } -- if (options->Has(Nan::New("strategy").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("strategy").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("strategy").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("strategy").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsString()) - { - Nan::ThrowTypeError("option 'strategy' must be one of the following strings: FILTERED, HUFFMAN_ONLY, RLE, FIXED, DEFAULT"); - return; - } -- else if (std::string("FILTERED") == TOSTR(param_val->ToString())) -+ else if (std::string("FILTERED") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_FILTERED; - } -- else if (std::string("HUFFMAN_ONLY") == TOSTR(param_val->ToString())) -+ else if (std::string("HUFFMAN_ONLY") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_HUFFMAN_ONLY; - } -- else if (std::string("RLE") == TOSTR(param_val->ToString())) -+ else if (std::string("RLE") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_RLE; - } -- else if (std::string("FIXED") == TOSTR(param_val->ToString())) -+ else if (std::string("FIXED") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_FIXED; - } -- else if (std::string("DEFAULT") == TOSTR(param_val->ToString())) -+ else if (std::string("DEFAULT") == TOSTR(param_val->ToString(Nan::GetCurrentContext()).ToLocalChecked())) - { - strategy = Z_DEFAULT_STRATEGY; - } -@@ -4610,6 +4618,7 @@ void VectorTile::get_data(uv_work_t* req) - void VectorTile::after_get_data(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_get_data_baton_t *closure = static_cast(req->data); - if (closure->error) - { -@@ -4618,13 +4627,13 @@ void VectorTile::after_get_data(uv_work_t* req) - // in test coverage. - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else if (!closure->data.empty()) - { - v8::Local argv[2] = { Nan::Null(), Nan::CopyBuffer((char*)closure->data.data(),closure->data.size()).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - else - { -@@ -4632,7 +4641,7 @@ void VectorTile::after_get_data(uv_work_t* req) - if (raw_size <= 0) - { - v8::Local argv[2] = { Nan::Null(), Nan::NewBuffer(0).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - else if (raw_size >= node::Buffer::kMaxLength) - { -@@ -4643,13 +4652,13 @@ void VectorTile::after_get_data(uv_work_t* req) - s << "Data is too large to convert to a node::Buffer "; - s << "(" << raw_size << " raw bytes >= node::Buffer::kMaxLength)"; - v8::Local argv[1] = { Nan::Error(s.str().c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local argv[2] = { Nan::Null(), Nan::CopyBuffer((char*)closure->d->tile_->data(),raw_size).ToLocalChecked() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - -@@ -4803,7 +4812,7 @@ NAN_METHOD(VectorTile::render) - Nan::ThrowTypeError("mapnik.Map expected as first arg"); - return; - } -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !Nan::New(Map::constructor)->HasInstance(obj)) - { - Nan::ThrowTypeError("mapnik.Map expected as first arg"); -@@ -4816,7 +4825,7 @@ NAN_METHOD(VectorTile::render) - Nan::ThrowTypeError("a renderable mapnik object is expected as second arg"); - return; - } -- v8::Local im_obj = info[1]->ToObject(); -+ v8::Local im_obj = info[1]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - - // ensure callback is a function - v8::Local callback = info[info.Length()-1]; -@@ -4840,40 +4849,40 @@ NAN_METHOD(VectorTile::render) - Nan::ThrowTypeError("optional third argument must be an options object"); - return; - } -- options = info[2]->ToObject(); -- if (options->Has(Nan::New("z").ToLocalChecked())) -+ options = info[2]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); -+ if (Nan::Has(options, Nan::New("z").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("z").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("z").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'z' must be a number"); - return; - } -- closure->z = bind_opt->IntegerValue(); -+ closure->z = Nan::To(bind_opt).FromJust(); - set_z = true; - closure->zxy_override = true; - } -- if (options->Has(Nan::New("x").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("x").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("x").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("x").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'x' must be a number"); - return; - } -- closure->x = bind_opt->IntegerValue(); -+ closure->x = Nan::To(bind_opt).FromJust(); - set_x = true; - closure->zxy_override = true; - } -- if (options->Has(Nan::New("y").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("y").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("y").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("y").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'y' must be a number"); - return; - } -- closure->y = bind_opt->IntegerValue(); -+ closure->y = Nan::To(bind_opt).FromJust(); - set_y = true; - closure->zxy_override = true; - } -@@ -4903,45 +4912,45 @@ NAN_METHOD(VectorTile::render) - } - } - -- if (options->Has(Nan::New("buffer_size").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("buffer_size").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("buffer_size").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("buffer_size").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'buffer_size' must be a number"); - return; - } -- closure->buffer_size = bind_opt->IntegerValue(); -+ closure->buffer_size = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("scale").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale' must be a number"); - return; - } -- closure->scale_factor = bind_opt->NumberValue(); -+ closure->scale_factor = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("scale_denominator").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("scale_denominator").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("scale_denominator").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("scale_denominator").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsNumber()) - { - Nan::ThrowTypeError("optional arg 'scale_denominator' must be a number"); - return; - } -- closure->scale_denominator = bind_opt->NumberValue(); -+ closure->scale_denominator = Nan::To(bind_opt).FromJust(); - } -- if (options->Has(Nan::New("variables").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("variables").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local bind_opt = options->Get(Nan::New("variables").ToLocalChecked()); -+ v8::Local bind_opt = Nan::Get(options, Nan::New("variables").ToLocalChecked()).ToLocalChecked(); - if (!bind_opt->IsObject()) - { - Nan::ThrowTypeError("optional arg 'variables' must be an object"); - return; - } -- object_to_container(closure->variables,bind_opt->ToObject()); -+ object_to_container(closure->variables,bind_opt->ToObject(Nan::GetCurrentContext()).ToLocalChecked()); - } - } - -@@ -4961,9 +4970,9 @@ NAN_METHOD(VectorTile::render) - closure->width = c->width(); - closure->height = c->height(); - closure->surface = c; -- if (options->Has(Nan::New("renderer").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("renderer").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local renderer = options->Get(Nan::New("renderer").ToLocalChecked()); -+ v8::Local renderer = Nan::Get(options, Nan::New("renderer").ToLocalChecked()).ToLocalChecked(); - if (!renderer->IsString() ) - { - Nan::ThrowError("'renderer' option must be a string of either 'svg' or 'cairo'"); -@@ -4997,7 +5006,7 @@ NAN_METHOD(VectorTile::render) - std::size_t layer_idx = 0; - - // grid requires special options for now -- if (!options->Has(Nan::New("layer").ToLocalChecked())) -+ if (!Nan::Has(options, Nan::New("layer").ToLocalChecked()).FromMaybe(false)) - { - Nan::ThrowTypeError("'layer' option required for grid rendering and must be either a layer name(string) or layer index (integer)"); - return; -@@ -5005,7 +5014,7 @@ NAN_METHOD(VectorTile::render) - else - { - std::vector const& layers = m->get()->layers(); -- v8::Local layer_id = options->Get(Nan::New("layer").ToLocalChecked()); -+ v8::Local layer_id = Nan::Get(options, Nan::New("layer").ToLocalChecked()).ToLocalChecked(); - if (layer_id->IsString()) - { - bool found = false; -@@ -5031,7 +5040,7 @@ NAN_METHOD(VectorTile::render) - } - else if (layer_id->IsNumber()) - { -- layer_idx = layer_id->IntegerValue(); -+ layer_idx = Nan::To(layer_id).FromJust(); - std::size_t layer_num = layers.size(); - if (layer_idx >= layer_num) - { -@@ -5055,9 +5064,9 @@ NAN_METHOD(VectorTile::render) - return; - } - } -- if (options->Has(Nan::New("fields").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("fields").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("fields").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("fields").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsArray()) - { - Nan::ThrowTypeError("option 'fields' must be an array of strings"); -@@ -5068,7 +5077,7 @@ NAN_METHOD(VectorTile::render) - unsigned int num_fields = a->Length(); - while (i < num_fields) - { -- v8::Local name = a->Get(i); -+ v8::Local name = Nan::Get(a, i).ToLocalChecked(); - if (name->IsString()) - { - g->get()->add_field(TOSTR(name)); -@@ -5299,30 +5308,31 @@ void VectorTile::EIO_RenderTile(uv_work_t* req) - void VectorTile::EIO_AfterRenderTile(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - vector_tile_render_baton_t *closure = static_cast(req->data); - if (closure->error) - { - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - else - { - if (closure->surface.is()) - { - v8::Local argv[2] = { Nan::Null(), mapnik::util::get(closure->surface)->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - #if defined(GRID_RENDERER) - else if (closure->surface.is()) - { - v8::Local argv[2] = { Nan::Null(), mapnik::util::get(closure->surface)->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - #endif - else if (closure->surface.is()) - { - v8::Local argv[2] = { Nan::Null(), mapnik::util::get(closure->surface)->handle() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - } - -@@ -5423,19 +5433,20 @@ void VectorTile::EIO_Clear(uv_work_t* req) - void VectorTile::EIO_AfterClear(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - clear_vector_tile_baton_t *closure = static_cast(req->data); - if (closure->error) - { - // No reason this should ever throw an exception, not currently testable. - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->error_name.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local argv[1] = { Nan::Null() }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - } - closure->d->Unref(); - closure->cb.Reset(); -@@ -5910,9 +5921,9 @@ v8::Local make_not_simple_array(std::vector & err - { - // LCOV_EXCL_START - v8::Local obj = Nan::New(); -- obj->Set(layer_key, Nan::New(error.layer).ToLocalChecked()); -- obj->Set(feature_id_key, Nan::New(error.feature_id)); -- array->Set(idx++, obj); -+ Nan::Set(obj, layer_key, Nan::New(error.layer).ToLocalChecked()); -+ Nan::Set(obj, feature_id_key, Nan::New(error.feature_id)); -+ Nan::Set(array, idx++, obj); - // LCOV_EXCL_STOP - } - return scope.Escape(array); -@@ -5951,11 +5962,11 @@ v8::Local make_not_valid_array(std::vector & error - for (auto const& error : errors) - { - v8::Local obj = Nan::New(); -- obj->Set(layer_key, Nan::New(error.layer).ToLocalChecked()); -- obj->Set(message_key, Nan::New(error.message).ToLocalChecked()); -- obj->Set(feature_id_key, Nan::New(error.feature_id)); -- obj->Set(geojson_key, Nan::New(error.geojson).ToLocalChecked()); -- array->Set(idx++, obj); -+ Nan::Set(obj, layer_key, Nan::New(error.layer).ToLocalChecked()); -+ Nan::Set(obj, message_key, Nan::New(error.message).ToLocalChecked()); -+ Nan::Set(obj, feature_id_key, Nan::New(error.feature_id)); -+ Nan::Set(obj, geojson_key, Nan::New(error.geojson).ToLocalChecked()); -+ Nan::Set(array, idx++, obj); - } - return scope.Escape(array); - } -@@ -6059,39 +6070,39 @@ v8::Local VectorTile::_reportGeometryValiditySync(Nan::NAN_METHOD_ARG - Nan::ThrowError("The first argument must be an object"); - return scope.Escape(Nan::Undefined()); - } -- v8::Local options = info[0]->ToObject(); -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("split_multi_features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("split_multi_features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("split_multi_features").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("split_multi_features").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'split_multi_features' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- split_multi_features = param_val->BooleanValue(); -+ split_multi_features = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("lat_lon").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("lat_lon").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("lat_lon").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("lat_lon").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'lat_lon' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- lat_lon = param_val->BooleanValue(); -+ lat_lon = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("web_merc").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("web_merc").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("web_merc").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("web_merc").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'web_merc' must be a boolean"); - return scope.Escape(Nan::Undefined()); - } -- web_merc = param_val->BooleanValue(); -+ web_merc = Nan::To(param_val).FromJust(); - } - } - VectorTile* d = Nan::ObjectWrap::Unwrap(info.Holder()); -@@ -6170,19 +6181,20 @@ void VectorTile::EIO_ReportGeometrySimplicity(uv_work_t* req) - void VectorTile::EIO_AfterReportGeometrySimplicity(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - not_simple_baton *closure = static_cast(req->data); - if (closure->error) - { - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->err_msg.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local array = make_not_simple_array(closure->result); - v8::Local argv[2] = { Nan::Null(), array }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->v->Unref(); - closure->cb.Reset(); -@@ -6226,39 +6238,39 @@ NAN_METHOD(VectorTile::reportGeometryValidity) - Nan::ThrowError("The first argument must be an object"); - return; - } -- v8::Local options = info[0]->ToObject(); -+ v8::Local options = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - -- if (options->Has(Nan::New("split_multi_features").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("split_multi_features").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("split_multi_features").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("split_multi_features").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'split_multi_features' must be a boolean"); - return; - } -- split_multi_features = param_val->BooleanValue(); -+ split_multi_features = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("lat_lon").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("lat_lon").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("lat_lon").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("lat_lon").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'lat_lon' must be a boolean"); - return; - } -- lat_lon = param_val->BooleanValue(); -+ lat_lon = Nan::To(param_val).FromJust(); - } - -- if (options->Has(Nan::New("web_merc").ToLocalChecked())) -+ if (Nan::Has(options, Nan::New("web_merc").ToLocalChecked()).FromMaybe(false)) - { -- v8::Local param_val = options->Get(Nan::New("web_merc").ToLocalChecked()); -+ v8::Local param_val = Nan::Get(options, Nan::New("web_merc").ToLocalChecked()).ToLocalChecked(); - if (!param_val->IsBoolean()) - { - Nan::ThrowError("option 'web_merc' must be a boolean"); - return; - } -- web_merc = param_val->BooleanValue(); -+ web_merc = Nan::To(param_val).FromJust(); - } - } - // ensure callback is a function -@@ -6301,19 +6313,20 @@ void VectorTile::EIO_ReportGeometryValidity(uv_work_t* req) - void VectorTile::EIO_AfterReportGeometryValidity(uv_work_t* req) - { - Nan::HandleScope scope; -+ Nan::AsyncResource async_resource(__func__); - not_valid_baton *closure = static_cast(req->data); - if (closure->error) - { - // LCOV_EXCL_START - v8::Local argv[1] = { Nan::Error(closure->err_msg.c_str()) }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 1, argv); - // LCOV_EXCL_STOP - } - else - { - v8::Local array = make_not_valid_array(closure->result); - v8::Local argv[2] = { Nan::Null(), array }; -- Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); -+ async_resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv); - } - closure->v->Unref(); - closure->cb.Reset(); -@@ -6361,7 +6374,7 @@ NAN_SETTER(VectorTile::set_tile_x) - } - else - { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val < 0) - { - Nan::ThrowError("tile x coordinate must be greater then or equal to zero"); -@@ -6380,7 +6393,7 @@ NAN_SETTER(VectorTile::set_tile_y) - } - else - { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val < 0) - { - Nan::ThrowError("tile y coordinate must be greater then or equal to zero"); -@@ -6399,7 +6412,7 @@ NAN_SETTER(VectorTile::set_tile_z) - } - else - { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val < 0) - { - Nan::ThrowError("tile z coordinate must be greater then or equal to zero"); -@@ -6418,7 +6431,7 @@ NAN_SETTER(VectorTile::set_tile_size) - } - else - { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (val <= 0) - { - Nan::ThrowError("tile size must be greater then zero"); -@@ -6437,7 +6450,7 @@ NAN_SETTER(VectorTile::set_buffer_size) - } - else - { -- int val = value->IntegerValue(); -+ int val = Nan::To(value).FromJust(); - if (static_cast(d->tile_size()) + (2 * val) <= 0) - { - Nan::ThrowError("too large of a negative buffer for tilesize"); -@@ -6499,7 +6512,7 @@ NAN_METHOD(VectorTile::info) - return; - } - -- v8::Local obj = info[0]->ToObject(); -+ v8::Local obj = info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked(); - if (obj->IsNull() || obj->IsUndefined() || !node::Buffer::HasInstance(obj)) - { - Nan::ThrowTypeError("first argument is invalid, must be a Buffer"); -@@ -6570,15 +6583,15 @@ NAN_METHOD(VectorTile::info) - { - errors.insert(mapnik::vector_tile_impl::TILE_REPEATED_LAYER_NAMES); - } -- layer_obj->Set(Nan::New("name").ToLocalChecked(), Nan::New(layer_name).ToLocalChecked()); -+ Nan::Set(layer_obj, Nan::New("name").ToLocalChecked(), Nan::New(layer_name).ToLocalChecked()); - } -- layer_obj->Set(Nan::New("features").ToLocalChecked(), Nan::New(feature_count)); -- layer_obj->Set(Nan::New("point_features").ToLocalChecked(), Nan::New(point_feature_count)); -- layer_obj->Set(Nan::New("linestring_features").ToLocalChecked(), Nan::New(line_feature_count)); -- layer_obj->Set(Nan::New("polygon_features").ToLocalChecked(), Nan::New(polygon_feature_count)); -- layer_obj->Set(Nan::New("unknown_features").ToLocalChecked(), Nan::New(unknown_feature_count)); -- layer_obj->Set(Nan::New("raster_features").ToLocalChecked(), Nan::New(raster_feature_count)); -- layer_obj->Set(Nan::New("version").ToLocalChecked(), Nan::New(layer_version)); -+ Nan::Set(layer_obj, Nan::New("features").ToLocalChecked(), Nan::New(feature_count)); -+ Nan::Set(layer_obj, Nan::New("point_features").ToLocalChecked(), Nan::New(point_feature_count)); -+ Nan::Set(layer_obj, Nan::New("linestring_features").ToLocalChecked(), Nan::New(line_feature_count)); -+ Nan::Set(layer_obj, Nan::New("polygon_features").ToLocalChecked(), Nan::New(polygon_feature_count)); -+ Nan::Set(layer_obj, Nan::New("unknown_features").ToLocalChecked(), Nan::New(unknown_feature_count)); -+ Nan::Set(layer_obj, Nan::New("raster_features").ToLocalChecked(), Nan::New(raster_feature_count)); -+ Nan::Set(layer_obj, Nan::New("version").ToLocalChecked(), Nan::New(layer_version)); - if (!layer_errors.empty()) - { - has_errors = true; -@@ -6586,9 +6599,9 @@ NAN_METHOD(VectorTile::info) - std::size_t i = 0; - for (auto const& e : layer_errors) - { -- err_arr->Set(i++, Nan::New(mapnik::vector_tile_impl::validity_error_to_string(e)).ToLocalChecked()); -+ Nan::Set(err_arr, i++, Nan::New(mapnik::vector_tile_impl::validity_error_to_string(e)).ToLocalChecked()); - } -- layer_obj->Set(Nan::New("errors").ToLocalChecked(), err_arr); -+ Nan::Set(layer_obj, Nan::New("errors").ToLocalChecked(), err_arr); - } - if (first_layer) - { -@@ -6602,7 +6615,7 @@ NAN_METHOD(VectorTile::info) - } - } - first_layer = false; -- layers->Set(layers_size++, layer_obj); -+ Nan::Set(layers, layers_size++, layer_obj); - } - break; - default: -@@ -6616,18 +6629,18 @@ NAN_METHOD(VectorTile::info) - { - errors.insert(mapnik::vector_tile_impl::INVALID_PBF_BUFFER); - } -- out->Set(Nan::New("layers").ToLocalChecked(), layers); -+ Nan::Set(out, Nan::New("layers").ToLocalChecked(), layers); - has_errors = has_errors || !errors.empty(); -- out->Set(Nan::New("errors").ToLocalChecked(), Nan::New(has_errors)); -+ Nan::Set(out, Nan::New("errors").ToLocalChecked(), Nan::New(has_errors)); - if (!errors.empty()) - { - v8::Local err_arr = Nan::New(); - std::size_t i = 0; - for (auto const& e : errors) - { -- err_arr->Set(i++, Nan::New(mapnik::vector_tile_impl::validity_error_to_string(e)).ToLocalChecked()); -+ Nan::Set(err_arr, i++, Nan::New(mapnik::vector_tile_impl::validity_error_to_string(e)).ToLocalChecked()); - } -- out->Set(Nan::New("tile_errors").ToLocalChecked(), err_arr); -+ Nan::Set(out, Nan::New("tile_errors").ToLocalChecked(), err_arr); - } - info.GetReturnValue().Set(out); - return; -diff --git a/src/node_mapnik.cpp b/src/node_mapnik.cpp -index 2b8627f4..891bfd3d 100644 ---- a/src/node_mapnik.cpp -+++ b/src/node_mapnik.cpp -@@ -164,84 +164,84 @@ extern "C" { - - // versions of deps - v8::Local versions = Nan::New(); -- versions->Set(Nan::New("node").ToLocalChecked(), Nan::New(NODE_VERSION+1).ToLocalChecked()); // NOTE: +1 strips the v in v0.10.26 -- versions->Set(Nan::New("v8").ToLocalChecked(), Nan::New(v8::V8::GetVersion()).ToLocalChecked()); -- versions->Set(Nan::New("boost").ToLocalChecked(), Nan::New(format_version(BOOST_VERSION)).ToLocalChecked()); -- versions->Set(Nan::New("boost_number").ToLocalChecked(), Nan::New(BOOST_VERSION)); -- versions->Set(Nan::New("mapnik").ToLocalChecked(), Nan::New(format_version(MAPNIK_VERSION)).ToLocalChecked()); -- versions->Set(Nan::New("mapnik_number").ToLocalChecked(), Nan::New(MAPNIK_VERSION)); -- versions->Set(Nan::New("mapnik_git_describe").ToLocalChecked(), Nan::New(MAPNIK_GIT_REVISION).ToLocalChecked()); -+ Nan::Set(versions, Nan::New("node").ToLocalChecked(), Nan::New(&NODE_VERSION[1]).ToLocalChecked()); // NOTE: +1 strips the v in v0.10.26 -+ Nan::Set(versions, Nan::New("v8").ToLocalChecked(), Nan::New(v8::V8::GetVersion()).ToLocalChecked()); -+ Nan::Set(versions, Nan::New("boost").ToLocalChecked(), Nan::New(format_version(BOOST_VERSION)).ToLocalChecked()); -+ Nan::Set(versions, Nan::New("boost_number").ToLocalChecked(), Nan::New(BOOST_VERSION)); -+ Nan::Set(versions, Nan::New("mapnik").ToLocalChecked(), Nan::New(format_version(MAPNIK_VERSION)).ToLocalChecked()); -+ Nan::Set(versions, Nan::New("mapnik_number").ToLocalChecked(), Nan::New(MAPNIK_VERSION)); -+ Nan::Set(versions, Nan::New("mapnik_git_describe").ToLocalChecked(), Nan::New(MAPNIK_GIT_REVISION).ToLocalChecked()); - #if defined(HAVE_CAIRO) -- versions->Set(Nan::New("cairo").ToLocalChecked(), Nan::New(CAIRO_VERSION_STRING).ToLocalChecked()); -+ Nan::Set(versions, Nan::New("cairo").ToLocalChecked(), Nan::New(CAIRO_VERSION_STRING).ToLocalChecked()); - #endif -- target->Set(Nan::New("versions").ToLocalChecked(), versions); -+ Nan::Set(target, Nan::New("versions").ToLocalChecked(), versions); - - v8::Local supports = Nan::New(); - #ifdef GRID_RENDERER -- supports->Set(Nan::New("grid").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("grid").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("grid").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("grid").ToLocalChecked(), Nan::False()); - #endif - - #ifdef SVG_RENDERER -- supports->Set(Nan::New("svg").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("svg").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("svg").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("svg").ToLocalChecked(), Nan::False()); - #endif - - #if defined(HAVE_CAIRO) -- supports->Set(Nan::New("cairo").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("cairo").ToLocalChecked(), Nan::True()); - #ifdef CAIRO_HAS_PDF_SURFACE -- supports->Set(Nan::New("cairo_pdf").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("cairo_pdf").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("cairo_pdf").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("cairo_pdf").ToLocalChecked(), Nan::False()); - #endif - #ifdef CAIRO_HAS_SVG_SURFACE -- supports->Set(Nan::New("cairo_svg").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("cairo_svg").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("cairo_svg").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("cairo_svg").ToLocalChecked(), Nan::False()); - #endif - #else -- supports->Set(Nan::New("cairo").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("cairo").ToLocalChecked(), Nan::False()); - #endif - - #if defined(HAVE_PNG) -- supports->Set(Nan::New("png").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("png").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("png").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("png").ToLocalChecked(), Nan::False()); - #endif - - #if defined(HAVE_JPEG) -- supports->Set(Nan::New("jpeg").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("jpeg").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("jpeg").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("jpeg").ToLocalChecked(), Nan::False()); - #endif - - #if defined(HAVE_TIFF) -- supports->Set(Nan::New("tiff").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("tiff").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("tiff").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("tiff").ToLocalChecked(), Nan::False()); - #endif - - #if defined(HAVE_WEBP) -- supports->Set(Nan::New("webp").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("webp").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("webp").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("webp").ToLocalChecked(), Nan::False()); - #endif - - #if defined(MAPNIK_USE_PROJ4) -- supports->Set(Nan::New("proj4").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("proj4").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("proj4").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("proj4").ToLocalChecked(), Nan::False()); - #endif - - #if defined(MAPNIK_THREADSAFE) -- supports->Set(Nan::New("threadsafe").ToLocalChecked(), Nan::True()); -+ Nan::Set(supports, Nan::New("threadsafe").ToLocalChecked(), Nan::True()); - #else -- supports->Set(Nan::New("threadsafe").ToLocalChecked(), Nan::False()); -+ Nan::Set(supports, Nan::New("threadsafe").ToLocalChecked(), Nan::False()); - #endif - -- target->Set(Nan::New("supports").ToLocalChecked(), supports); -+ Nan::Set(target, Nan::New("supports").ToLocalChecked(), supports); - - - /** -@@ -326,8 +326,7 @@ extern "C" { - NODE_MAPNIK_DEFINE_CONSTANT(composite_ops, "linear_dodge", mapnik::linear_dodge) - NODE_MAPNIK_DEFINE_CONSTANT(composite_ops, "linear_burn", mapnik::linear_burn) - NODE_MAPNIK_DEFINE_CONSTANT(composite_ops, "divide", mapnik::divide) -- target->Set(Nan::New("compositeOp").ToLocalChecked(), composite_ops); -- -+ Nan::Set(target, Nan::New("compositeOp").ToLocalChecked(), composite_ops); - /** - * Image type constants representing color and grayscale encodings. - * -@@ -360,7 +359,7 @@ extern "C" { - NODE_MAPNIK_DEFINE_CONSTANT(image_types, "gray64", mapnik::image_dtype_gray64) - NODE_MAPNIK_DEFINE_CONSTANT(image_types, "gray64s", mapnik::image_dtype_gray64s) - NODE_MAPNIK_DEFINE_CONSTANT(image_types, "gray64f", mapnik::image_dtype_gray64f) -- target->Set(Nan::New("imageType").ToLocalChecked(), image_types); -+ Nan::Set(target, Nan::New("imageType").ToLocalChecked(), image_types); - - /** - * Image scaling type constants representing color and grayscale encodings. -@@ -405,7 +404,7 @@ extern "C" { - NODE_MAPNIK_DEFINE_CONSTANT(image_scaling_types, "sinc", mapnik::SCALING_SINC) - NODE_MAPNIK_DEFINE_CONSTANT(image_scaling_types, "lanczos", mapnik::SCALING_LANCZOS) - NODE_MAPNIK_DEFINE_CONSTANT(image_scaling_types, "blackman", mapnik::SCALING_BLACKMAN) -- target->Set(Nan::New("imageScaling").ToLocalChecked(), image_scaling_types); -+ Nan::Set(target, Nan::New("imageScaling").ToLocalChecked(), image_scaling_types); - - /** - * Constants representing fill types understood by [Clipper during vector tile encoding](http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm). -@@ -424,7 +423,7 @@ extern "C" { - NODE_MAPNIK_DEFINE_CONSTANT(polygon_fill_types, "nonZero", mapnik::vector_tile_impl::non_zero_fill) - NODE_MAPNIK_DEFINE_CONSTANT(polygon_fill_types, "positive", mapnik::vector_tile_impl::positive_fill) - NODE_MAPNIK_DEFINE_CONSTANT(polygon_fill_types, "negative", mapnik::vector_tile_impl::negative_fill) -- target->Set(Nan::New("polygonFillType").ToLocalChecked(), polygon_fill_types); -+ Nan::Set(target, Nan::New("polygonFillType").ToLocalChecked(), polygon_fill_types); - - /** - * Constants representing `std::async` threading mode (aka [launch policy](http://en.cppreference.com/w/cpp/thread/launch)). -@@ -440,7 +439,7 @@ extern "C" { - NODE_MAPNIK_DEFINE_CONSTANT(threading_mode, "async", static_cast(std::launch::async)) - NODE_MAPNIK_DEFINE_CONSTANT(threading_mode, "deferred", static_cast(std::launch::deferred)) - NODE_MAPNIK_DEFINE_CONSTANT(threading_mode, "auto", static_cast(std::launch::async | std::launch::deferred)) -- target->Set(Nan::New("threadingMode").ToLocalChecked(), threading_mode); -+ Nan::Set(target, Nan::New("threadingMode").ToLocalChecked(), threading_mode); - - } - } -diff --git a/src/object_to_container.hpp b/src/object_to_container.hpp -index e7c11c58..2030d05e 100644 ---- a/src/object_to_container.hpp -+++ b/src/object_to_container.hpp -@@ -8,21 +8,21 @@ - - static inline void object_to_container(mapnik::attributes & cont, v8::Local const& vars) - { -- v8::Local names = vars->GetPropertyNames(); -+ v8::Local names = Nan::GetPropertyNames(vars).ToLocalChecked(); - std::size_t a_length = names->Length(); - mapnik::transcoder tr("utf8"); - cont.reserve(a_length); - for(std::size_t i=0; i < a_length; ++i) { -- v8::Local name = names->Get(i)->ToString(); -- v8::Local value = vars->Get(name); -+ v8::Local name = Nan::Get(names, i).ToLocalChecked()->ToString(Nan::GetCurrentContext()).ToLocalChecked(); -+ v8::Local value = Nan::Get(vars, name).ToLocalChecked(); - if (value->IsBoolean()) { -- cont[TOSTR(name)] = value->ToBoolean()->Value(); -+ cont[TOSTR(name)] = Nan::To(value).FromJust(); - } else if (value->IsString()) { - cont[TOSTR(name)] = tr.transcode(TOSTR(value)); - } else if (value->IsNumber()) { -- mapnik::value_double num = value->NumberValue(); -- if (num == value->IntegerValue()) { -- cont[TOSTR(name)] = static_cast(value->IntegerValue()); -+ mapnik::value_double num = Nan::To(value).FromJust(); -+ if (num == Nan::To(value).FromJust()) { -+ cont[TOSTR(name)] = Nan::To(value).FromJust(); - } else { - cont[TOSTR(name)] = num; - } -diff --git a/src/utils.hpp b/src/utils.hpp -index 00d577f8..3ad80c38 100644 ---- a/src/utils.hpp -+++ b/src/utils.hpp -@@ -31,12 +31,10 @@ - Nan::SetAccessor(t->InstanceTemplate(), Nan::New(name).ToLocalChecked(), get, set); - - #define NODE_MAPNIK_DEFINE_CONSTANT(target, name, constant) \ -- (target)->Set(Nan::New(name).ToLocalChecked(), \ -- Nan::New(constant)); \ -+ Nan::Set((target), Nan::New(name).ToLocalChecked(), Nan::New(constant)); - - #define NODE_MAPNIK_DEFINE_64_BIT_CONSTANT(target, name, constant) \ -- (target)->Set(Nan::New(name).ToLocalChecked(), \ -- Nan::New(constant)); \ -+ Nan::Set((target), Nan::New(name).ToLocalChecked(), Nan::New(constant)); - - - -@@ -83,7 +81,7 @@ struct value_converter - - inline void params_to_object(v8::Local& ds, std::string const& key, mapnik::value_holder const& val) - { -- ds->Set(Nan::New(key.c_str()).ToLocalChecked(), mapnik::util::apply_visitor(value_converter(), val)); -+ Nan::Set(ds, Nan::New(key.c_str()).ToLocalChecked(), mapnik::util::apply_visitor(value_converter(), val)); - } - - } // end ns -diff --git a/test/vector-tile.test.js b/test/vector-tile.test.js -index 8f1f3b41..cb8b61e5 100644 ---- a/test/vector-tile.test.js -+++ b/test/vector-tile.test.js -@@ -1893,7 +1893,8 @@ describe('mapnik.VectorTile ', function() { - assert.equal(feature_count, 1); - vtile.clear(); - assert.equal(vtile.getData().length,0); -- assert.deepEqual(vtile.toJSON(), {}); -+ // Node 12 returns [] -+// assert.deepEqual(vtile2.toJSON(), {}); - assert.equal(vtile.painted(), false); - - // call synchronous method directly -@@ -1905,7 +1906,8 @@ describe('mapnik.VectorTile ', function() { - assert.equal(feature_count2, 1); - vtile2.clearSync(); - assert.equal(vtile2.getData().length,0); -- assert.deepEqual(vtile2.toJSON(), {}); -+ // Node 12 returns [] -+// assert.deepEqual(vtile2.toJSON(), {}); - assert.equal(vtile2.painted(), false); - done(); - }); -@@ -1926,7 +1928,8 @@ describe('mapnik.VectorTile ', function() { - assert.equal(vtile.empty(), true); - assert.deepEqual(vtile.names(), []); - assert.equal(vtile.getData().length,0); -- assert.deepEqual(vtile.toJSON(), {}); -+ // Node 12 returns [] -+// assert.deepEqual(vtile.toJSON(), {}); - assert.equal(vtile.painted(), false); - done(); - }); -@@ -1956,7 +1959,8 @@ describe('mapnik.VectorTile ', function() { - assert.equal(vtile.empty(), true); - assert.deepEqual(vtile.names(), []); - assert.equal(vtile.getData().length,0); -- assert.deepEqual(vtile.toJSON(), {}); -+ // Node 12 returns [] -+// assert.deepEqual(vtile2.toJSON(), {}); - assert.equal(vtile.painted(), false); - done(); - }); diff --git a/nodejs-mapnik-pregyp.patch b/nodejs-mapnik-pregyp.patch deleted file mode 100644 index 2d0b644..0000000 --- a/nodejs-mapnik-pregyp.patch +++ /dev/null @@ -1,67 +0,0 @@ -commit c151ffeb1f10a35a5228e2fc2ebe81e274fc56ae -Author: Tom Hughes -Date: Mon Aug 18 14:30:51 2014 +0100 - - Patch out use of node-pre-gyp - -diff --git a/bin/mapnik-index.js b/bin/mapnik-index.js -index ec1f2490..0e18ada5 100755 ---- a/bin/mapnik-index.js -+++ b/bin/mapnik-index.js -@@ -2,9 +2,8 @@ - - 'use strict'; - --var binary = require('node-pre-gyp'), -- path = require('path'), -- bindingPath = binary.find(path.resolve(__dirname, '..', 'package.json')), -+var path = require('path'), -+ bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), - program = path.join(path.dirname(bindingPath), 'bin', 'mapnik-index'), - spawn = require('child_process').spawn, - fs = require('fs'); -diff --git a/bin/mapnik-shapeindex.js b/bin/mapnik-shapeindex.js -index 50b533dc..0d73b7f8 100755 ---- a/bin/mapnik-shapeindex.js -+++ b/bin/mapnik-shapeindex.js -@@ -2,9 +2,8 @@ - - 'use strict'; - --var binary = require('node-pre-gyp'), -- path = require('path'), -- bindingPath = binary.find(path.resolve(__dirname, '..', 'package.json')), -+var path = require('path'), -+ bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), - shapeindex = path.join(path.dirname(bindingPath), 'bin', 'shapeindex'), - spawn = require('child_process').spawn, - fs = require('fs'); -diff --git a/lib/mapnik.js b/lib/mapnik.js -index 4cbb721c..ef64c92e 100644 ---- a/lib/mapnik.js -+++ b/lib/mapnik.js -@@ -1,9 +1,8 @@ - "use strict"; - --var binary = require('node-pre-gyp'); - var exists = require('fs').existsSync || require('path').existsSync; - var path = require('path'); --var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))); -+var binding_path = path.resolve(path.join(__dirname,'binding/mapnik.node')); - var settings_path = path.join(path.dirname(binding_path),'mapnik_settings.js'); - var settings = require(settings_path); - -diff --git a/package.json b/package.json -index 221b70cc..86a12199 100644 ---- a/package.json -+++ b/package.json -@@ -38,8 +38,7 @@ - "dependencies": { - "mapnik-vector-tile": "1.6.1", - "protozero": "1.5.1", -- "nan": "~2.8.0", -- "node-pre-gyp": "~0.6.30" -+ "nan": "~2.8.0" - }, - "bundledDependencies": [ - "node-pre-gyp" diff --git a/nodejs-mapnik-proj6.patch b/nodejs-mapnik-proj6.patch deleted file mode 100644 index 0559e39..0000000 --- a/nodejs-mapnik-proj6.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit 61b50ba0614cba83f51ea371ddbbaa69e355481c -Author: Tom Hughes -Date: Tue Mar 3 12:18:03 2020 +0000 - - Patch for proj 6.x support - -diff --git a/test/proj_transform.test.js b/test/proj_transform.test.js -index 1c82776f..fa0147cb 100644 ---- a/test/proj_transform.test.js -+++ b/test/proj_transform.test.js -@@ -114,7 +114,7 @@ describe('mapnik.ProjTransform ', function() { - var from = new mapnik.Projection('+init=epsg:4326'); - var to = new mapnik.Projection('+init=epsg:3873'); - var trans = new mapnik.ProjTransform(from,to); -- var long_lat_box = [-180,90,180,90]; -+ var long_lat_box = [-181,91,181,91]; - assert.throws(function() { trans.forward(long_lat_box); }); - }); - -@@ -122,7 +122,7 @@ describe('mapnik.ProjTransform ', function() { - var from = new mapnik.Projection('+init=epsg:3873'); - var to = new mapnik.Projection('+init=epsg:4326'); - var trans = new mapnik.ProjTransform(from,to); -- var long_lat_box = [-180,90,180,90]; -+ var long_lat_box = [-181,91,181,91]; - assert.throws(function() { trans.backward(long_lat_box); }); - }); - diff --git a/nodejs-mapnik-relax-tests.patch b/nodejs-mapnik-relax-tests.patch deleted file mode 100644 index 413bed4..0000000 --- a/nodejs-mapnik-relax-tests.patch +++ /dev/null @@ -1,189 +0,0 @@ -commit 6c9db44beec23954df10deb041f8800ba9c187fb -Author: Tom Hughes -Date: Sun Dec 6 11:05:31 2015 +0000 - - Relax some test thresholds - -diff --git a/test/blend.test.js b/test/blend.test.js -index 4a6f73be..efc30c53 100644 ---- a/test/blend.test.js -+++ b/test/blend.test.js -@@ -437,7 +437,7 @@ describe('mapnik.blend', function() { - //fs.writeFileSync('test/blend-fixtures/actual-compression-5.webp',result); - var diff = expected.compare(actual); - // webp 0.5.0 leads to image with 730 diff pixels -- assert.ok(diff <= 730); -+ assert.ok(diff <= 750); - done(); - }); - }); -diff --git a/test/image.svg.test.js b/test/image.svg.test.js -index c09fec51..0dc9266c 100644 ---- a/test/image.svg.test.js -+++ b/test/image.svg.test.js -@@ -194,7 +194,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 256); - assert.equal(img.height(), 256); -- assert.equal(img.encodeSync('png32').length, 17571); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 17571) <= 100); - }); - - it('#fromSVGSync load from SVG file - 2', function() { -@@ -203,7 +203,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 256); - assert.equal(img.height(), 256); -- assert.equal(img.encodeSync('png32').length, 17571); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 17571) <= 100); - }); - - -@@ -212,7 +212,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img); assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 256); - assert.equal(img.height(), 256); -- assert.equal(img.encodeSync('png32').length, 17571); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 17571) <= 100); - assert.equal(img.premultiplied(), false); - done(); - }); -@@ -226,7 +226,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 100); - assert.equal(img.height(), 100); -- assert.equal(img.encodeSync("png").length, 1270); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 1270) <= 14); - }); - - it('#fromSVGBytesSync load from SVG buffer - 2', function() { -@@ -237,7 +237,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 100); - assert.equal(img.height(), 100); -- assert.equal(img.encodeSync("png").length, 1270); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 1270) <= 14); - }); - - it('#fromSVGBytes load from SVG buffer', function(done) { -@@ -248,7 +248,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 100); - assert.equal(img.height(), 100); -- assert.equal(img.encodeSync("png").length, 1270); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 1270) <= 14); - assert.equal(img.premultiplied(), false); - done(); - }); -@@ -262,7 +262,7 @@ describe('mapnik.Image SVG', function() { - assert.ok(img instanceof mapnik.Image); - assert.equal(img.width(), 50); - assert.equal(img.height(), 50); -- assert.equal(img.encodeSync("png").length, 616); -+ assert.ok(Math.abs(img.encodeSync('png32').length - 616) <= 4); - assert.equal(img.premultiplied(), false); - }); - -diff --git a/test/vector-tile.composite.test.js b/test/vector-tile.composite.test.js -index 1380a665..385aeea2 100644 ---- a/test/vector-tile.composite.test.js -+++ b/test/vector-tile.composite.test.js -@@ -108,7 +108,7 @@ function compare_to_image(actual,expected_file) { - console.log('generating expected image',expected_file); - actual.save(expected_file,"png32"); - } -- return actual.compare(new mapnik.Image.open(expected_file)); -+ return actual.compare(new mapnik.Image.open(expected_file), {threshold:36}); - } - - describe('mapnik.VectorTile.composite', function() { -@@ -307,25 +307,25 @@ describe('mapnik.VectorTile.composite', function() { - var expected_file2 = data_base +'/expected/world-reencode-max-extent.png'; - vtile.render(map,new mapnik.Image(256,256),function(err,im) { - if (err) throw err; -- assert.equal(0,compare_to_image(im,expected_file)); -+ assert.ok(compare_to_image(im,expected_file) <= 500); - vtile1.render(map,new mapnik.Image(256,256),function(err,im2) { - if (err) throw err; -- assert.equal(0,compare_to_image(im2,expected_file2)); -+ assert.ok(compare_to_image(im2,expected_file2) <= 500); - vtile3.composite([vtile2],{reencode:true}, function(err) { - if (err) throw err; - assert.equal(vtile3.getData().length,54837); - assert.deepEqual(vtile3.names(),["water","admin"]); - vtile3.render(map,new mapnik.Image(256,256),function(err,im) { - if (err) throw err; -- assert.equal(0,compare_to_image(im,expected_file)); -+ assert.ok(compare_to_image(im,expected_file) <= 500); - vtile4.composite([vtile2],{reencode:true,max_extent:world_clipping_extent}, function(err) { - if (err) throw err; - assert.equal(vtile4.getData().length,54576); - assert.deepEqual(vtile4.names(),["water","admin"]); -- assert.equal(0,compare_to_image(im2,expected_file2)); -+ assert.ok(compare_to_image(im2,expected_file2) <= 500); - vtile4.render(map,new mapnik.Image(256,256),function(err,im) { - if (err) throw err; -- assert.equal(0,compare_to_image(im,expected_file2)); -+ assert.ok(compare_to_image(im,expected_file2) <= 500); - done(); - }); - }); -diff --git a/test/vector-tile.query.test.js b/test/vector-tile.query.test.js -index bbe23350..41c6172f 100644 ---- a/test/vector-tile.query.test.js -+++ b/test/vector-tile.query.test.js -@@ -64,8 +64,8 @@ describe('mapnik.VectorTile query polygon', function() { - assert.equal(features[0].id(),89); - assert.equal(features[0].geometry().type(),mapnik.Geometry.Polygon); - assert.equal(features[0].distance,0); -- assert.equal(features[0].x_hit,0); -- assert.equal(features[0].y_hit,0); -+ assert.ok(Math.abs(features[0].x_hit) < 1e-8); -+ assert.ok(Math.abs(features[0].y_hit) < 1e-8); - assert.equal(features[0].layer,'world'); - assert.equal(JSON.parse(features[1].toJSON()).properties.NAME,'Japan'); - assert.equal(features[1].id(),89); -@@ -546,8 +546,8 @@ describe('mapnik.VectorTile query xy single features', function() { - }] - }),"layer-name"); - var res = vtile.query(0,0,{tolerance:1}); -- assert.equal(res[0].x_hit, 0); -- assert.equal(res[0].y_hit, 0); -+ assert.ok(Math.abs(res[0].x_hit) < 1e-8); -+ assert.ok(Math.abs(res[0].y_hit) < 1e-8); - assert.equal(res[0].attributes().name, 'A'); - done(); - }); -@@ -566,8 +566,8 @@ describe('mapnik.VectorTile query xy single features', function() { - }] - }),"layer-name"); - var res = vtile.query(0,0,{tolerance:1}); -- assert.equal(res[0].x_hit, 0); -- assert.equal(res[0].y_hit, 0); -+ assert.ok(Math.abs(res[0].x_hit) < 1e-8); -+ assert.ok(Math.abs(res[0].y_hit) < 1e-8); - assert.equal(res[0].attributes().name, 'A'); - done(); - }); -@@ -586,8 +586,8 @@ describe('mapnik.VectorTile query xy single features', function() { - }] - }),"layer-name"); - var res = vtile.query(0,0,{tolerance:1}); -- assert.equal(res[0].x_hit, 0); -- assert.equal(res[0].y_hit, 0); -+ assert.ok(Math.abs(res[0].x_hit) < 1e-8); -+ assert.ok(Math.abs(res[0].y_hit) < 1e-8); - assert.equal(res[0].attributes().name, 'A'); - done(); - }); -@@ -606,8 +606,8 @@ describe('mapnik.VectorTile query xy single features', function() { - }] - }),"layer-name"); - var res = vtile.query(0,0,{tolerance:1}); -- assert.equal(res[0].x_hit, 0); -- assert.equal(res[0].y_hit, 0); -+ assert.ok(Math.abs(res[0].x_hit) < 1e-8); -+ assert.ok(Math.abs(res[0].y_hit) < 1e-8); - assert.equal(res[0].attributes().name, 'A'); - done(); - }); diff --git a/nodejs-mapnik-system-libraries.patch b/nodejs-mapnik-system-libraries.patch deleted file mode 100644 index 7fe3edd..0000000 --- a/nodejs-mapnik-system-libraries.patch +++ /dev/null @@ -1,92 +0,0 @@ -commit 00a007014b80dc7df054626ef4d200594c9a2e7a -Author: Tom Hughes -Date: Sat Sep 10 12:00:00 2016 +0100 - - Build against system libraries - -diff --git a/bin/mapnik-index.js b/bin/mapnik-index.js -index 0e18ada5..04430dcc 100755 ---- a/bin/mapnik-index.js -+++ b/bin/mapnik-index.js -@@ -3,7 +3,7 @@ - 'use strict'; - - var path = require('path'), -- bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), -+ bindingPath = path.resolve(path.join(__dirname, '..', 'lib', 'binding', 'mapnik.node')), - program = path.join(path.dirname(bindingPath), 'bin', 'mapnik-index'), - spawn = require('child_process').spawn, - fs = require('fs'); -diff --git a/bin/mapnik-shapeindex.js b/bin/mapnik-shapeindex.js -index 0d73b7f8..d4fed9f2 100755 ---- a/bin/mapnik-shapeindex.js -+++ b/bin/mapnik-shapeindex.js -@@ -3,7 +3,7 @@ - 'use strict'; - - var path = require('path'), -- bindingPath = path.resolve(path.join(__dirname, 'binding/mapnik.node')), -+ bindingPath = path.resolve(path.join(__dirname, '..', 'lib', 'binding', 'mapnik.node')), - shapeindex = path.join(path.dirname(bindingPath), 'bin', 'shapeindex'), - spawn = require('child_process').spawn, - fs = require('fs'); -diff --git a/binding.gyp b/binding.gyp -index 6bdf3b18..79cfa70b 100644 ---- a/binding.gyp -+++ b/binding.gyp -@@ -34,16 +34,8 @@ - 4267 - ], - 'include_dirs': [ -- './mason_packages/.link/include/', -- './mason_packages/.link/include/freetype2', -- './mason_packages/.link/include/cairo', - './src', - "= %{mapnik_version} -BuildRequires: mapnik-static >= %{mapnik_version} -BuildRequires: protozero-devel >= %{protozero_version} -BuildRequires: protozero-static >= %{protozero_version} -BuildRequires: boost-devel -BuildRequires: libicu-devel -BuildRequires: freetype-devel -BuildRequires: sparsehash-devel -BuildRequires: cairo-devel -BuildRequires: polyclipping-devel -BuildRequires: protobuf-lite-devel -BuildRequires: libtool-ltdl-devel -BuildRequires: libxml2-devel -BuildRequires: npm(mapnik-vector-tile) >= %{mapnik_vector_tile_version} - -BuildRequires: mapnik-utils -BuildRequires: npm(mocha) -BuildRequires: npm(sphericalmercator) -BuildRequires: npm(nan) >= 2.8.0 - -%{?nodejs_default_filter} - -%description -%summary - - -%prep -%autosetup -S git -p 1 -n node-mapnik-%{version} -%nodejs_fixdep --remove protozero -%nodejs_fixdep --dev --move nan -%nodejs_fixdep --dev --move mapnik-vector-tile -rm -rf deps node_modules -echo '{}' > common.gypi - - -%build -%nodejs_symlink_deps --build -ls -l node_modules -%ifarch aarch64 ppc64le -export CXXFLAGS="%{optflags} -O1" -%else -export CXXFLAGS="%{optflags}" -%endif -export LDFLAGS="%{?__global_ldflags}" -node-gyp configure -- -Denable_sse=false -Dmodule_name=mapnik -Dmodule_path=lib/binding -node-gyp build -mkdir -p lib/binding -cp -p build/lib/binding/mapnik.node lib/binding -echo " -module.exports.paths = { - 'fonts': '$(mapnik-config --fonts)', - 'input_plugins': '$(mapnik-config --input-plugins)', - 'mapnik_index': '$(which mapnik-index)', - 'shape_index': '$(which shapeindex)' -}; -module.exports.env = { - 'ICU_DATA': '$(mapnik-config --icu-data)', - 'GDAL_DATA': '$(mapnik-config --gdal-data)', - 'PROJ_LIB': '$(mapnik-config --proj-lib)' -}; -" > lib/binding/mapnik_settings.js - - -%install -mkdir -p %{buildroot}/%{nodejs_sitearch}/mapnik -cp -pr package.json bin lib %{buildroot}/%{nodejs_sitearch}/mapnik -mkdir -p %{buildroot}/%{_bindir} -ln -s %{nodejs_sitelib}/mapnik/bin/mapnik-inspect.js %{buildroot}/%{_bindir}/mapnik-inspect -%nodejs_symlink_deps - - -%check -%nodejs_symlink_deps --check -cat lib/binding/mapnik_settings.js -%{nodejs_sitelib}/mocha/bin/mocha -R spec -t 10000 - - -%files -%doc README.md CHANGELOG.md CONTRIBUTING.md docs -%license LICENSE.txt -%{nodejs_sitearch}/mapnik -%{_bindir}/mapnik-* - - -%changelog -* Sat Aug 01 2020 Fedora Release Engineering - 3.7.2-15 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 28 2020 Fedora Release Engineering - 3.7.2-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Jun 29 2020 Tom Hughes - 3.7.2-13 -- Rebuild for Node.js 14.4.0 - -* Wed Jan 29 2020 Fedora Release Engineering - 3.7.2-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Jul 25 2019 Fedora Release Engineering - 3.7.2-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Jun 14 2019 Tom Hughes - 3.7.2-10 -- Rebuild for Node.js 12.4.0 - -* Tue Feb 5 2019 Tom Hughes - 3.7.2-9 -- Rebuilt for proj 5 - -* Fri Feb 01 2019 Fedora Release Engineering - 3.7.2-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Jan 29 2019 Tom Hughes - 3.7.2-7 -- Rebuilt for Boost 1.69 - -* Fri Jul 13 2018 Fedora Release Engineering - 3.7.2-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jul 10 2018 Pete Walter - 3.7.2-5 -- Rebuild for ICU 62 - -* Fri Jun 22 2018 Tom Hughes - 3.7.2-4 -- Rebuild for Node.js 10.5.0 - -* Mon Apr 30 2018 Tom Hughes - 3.7.2-3 -- Relax test thresholds for libwebp 1.0.0 changes - -* Mon Apr 30 2018 Pete Walter - 3.7.2-2 -- Rebuild for ICU 61.1 - -* Sun Apr 22 2018 Tom Hughes - 3.7.2-1 -- Update to 3.7.2 upstream release - -* Tue Mar 6 2018 Tom Hughes - 3.7.1-2 -- Rebuild against mapnik 3.0.19 - -* Sat Mar 3 2018 Tom Hughes - 3.7.1-1 -- Update to 3.7.1 upstream release - -* Tue Feb 27 2018 Tom Hughes - 3.7.0-1 -- Update to 3.7.0 upstream release - -* Thu Feb 08 2018 Fedora Release Engineering - 3.6.2-7.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Nov 30 2017 Pete Walter - 3.6.2-6.1 -- Rebuild for ICU 60.1 - -* Thu Aug 10 2017 Tom Hughes - 3.6.2-5.1 -- Rebuild for Node.js 8.3.0 - -* Thu Aug 03 2017 Fedora Release Engineering - 3.6.2-4.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 3.6.2-3.1 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Jul 21 2017 Kalev Lember - 3.6.2-2.1 -- Rebuilt for Boost 1.64 - -* Wed Jun 28 2017 Tom Hughes - 3.6.2-1.1 -- Rebuild for Node.js 8.1.2 - -* Wed Jun 21 2017 Tom Hughes - 3.6.2-1.{?dist} -- Update to 3.6.2 upstream release - -* Fri Jun 16 2017 Tom Hughes - 3.6.1-2 -- Rebuild against mapnik 3.0.15 - -* Wed Jun 14 2017 Tom Hughes - 3.6.1-1 -- Update to 3.6.1 upstream release - -* Mon May 15 2017 Fedora Release Engineering - 3.6.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild - -* Thu May 4 2017 Tom Hughes - 3.6.0-1 -- Update to 3.6.0 upstream release - -* Wed Feb 15 2017 Tom Hughes - 3.5.14-4 -- Patch tests for change in mapnik 3.0.13 - -* Fri Feb 10 2017 Fedora Release Engineering - 3.5.14-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Wed Nov 16 2016 Tom Hughes - 3.5.14-2 -- Exclude big endian architectures as mapnik does not support them -- Disable some tests that are failing on ppc64le - -* Sat Sep 10 2016 Tom Hughes - 3.5.14-1 -- Update to 3.5.14 upstream release - -* Mon Aug 29 2016 Tom Hughes - 3.5.12-3 -- Rebuild for Node.js 6.5.0 - -* Mon Aug 22 2016 Tom Hughes - 3.5.12-2 -- Rebuild for Node.js 6.1.0 upgrade - -* Tue Apr 19 2016 Tom Hughes - 3.5.12-1 -- Update to 3.5.12 upstream release - -* Sat Apr 16 2016 Tom Hughes - 3.5.11-1 -- Update to 3.5.11 upstream release - -* Thu Apr 14 2016 Tom Hughes - 3.5.10-1 -- Update to 3.5.10 upstream release - -* Sun Apr 10 2016 Tom Hughes - 3.5.8-1 -- Update to 3.5.8 upstream release - -* Tue Mar 29 2016 Tom Hughes - 3.5.6-2 -- Rebuild for Node.js 5.x - -* Tue Mar 29 2016 Tom Hughes - 3.5.6-1 -- Update to 3.5.6 upstream release - -* Thu Mar 24 2016 Tom Hughes - 3.5.5-1 -- Update to 3.5.5 upstream release - -* Wed Mar 23 2016 Tom Hughes - 3.5.4-2 -- Rebuild for Node.js 4.4.x - -* Tue Mar 22 2016 Tom Hughes - 3.5.4-1 -- Update to 3.5.4 upstream release - -* Thu Mar 3 2016 Tom Hughes - 3.5.2-1 -- Update to 3.5.2 upstream release - -* Wed Mar 2 2016 Tom Hughes - 3.5.1-1 -- Update to 3.5.1 upstream release - -* Sat Feb 13 2016 Tom Hughes - 3.4.16-5 -- Remove architecture specific test disablements - -* Wed Feb 10 2016 Tom Hughes - 3.4.16-4 -- Rebuild for Node.js 4.3.x - -* Tue Feb 2 2016 Tom Hughes - 3.4.16-3 -- Remove -fno-if-conversion and patch floating point comparisons - -* Sat Jan 30 2016 Tom Hughes - 3.4.16-2 -- Add -fno-if-conversion to avoid gcc 6 bug - -* Sat Jan 23 2016 Tom Hughes - 3.4.16-1 -- Update to 3.4.16 upstream release - -* Fri Jan 22 2016 Tom Hughes - 3.4.15-1 -- Update to 3.4.15 upstream release - -* Thu Jan 21 2016 Tom Hughes - 3.4.14-1 -- Update to 3.4.14 upstream release - -* Wed Jan 20 2016 Tom Hughes - 3.4.13-3 -- Rebuild for nodejs 4 - -* Fri Jan 8 2016 Tom Hughes - 3.4.13-2 -- Patch out node-pre-gyp correctly - -* Fri Jan 8 2016 Tom Hughes - 3.4.13-1 -- Update to 3.4.13 upstream release - -* Wed Dec 30 2015 Tom Hughes - 3.4.12-3 -- Update expected output for libwebp 0.5.x - -* Wed Dec 23 2015 Tom Hughes - 3.4.12-2 -- Rebuild for mapnik-vector-tile 0.14.2 - -* Sat Dec 19 2015 Tom Hughes - 3.4.12-1 -- Update to 3.4.12 upstream release - -* Sun Dec 6 2015 Tom Hughes - 3.4.11-2 -- Drop mapnik-render from bindir as mapnik now provides it - -* Sun Dec 6 2015 Tom Hughes - 3.4.11-1 -- Update to 3.4.11 upstream release - -* Fri Oct 30 2015 Tom Hughes - 1.4.17-11 -- Rebuild for ICU 56.1 - -* Wed Jul 29 2015 Fedora Release Engineering - 1.4.17-10 -- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 - -* Fri Jul 24 2015 Tom Hughes - 1.4.17-9 -- Rebuild for boost 1.58.0 - -* Sat Jul 18 2015 Tom Hughes - 1.4.17-8 -- Rebuild for boost 1.58.0 - -* Wed Jun 17 2015 Fedora Release Engineering - 1.4.17-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Wed Apr 29 2015 Kalev Lember - 1.4.17-6 -- Rebuilt for protobuf soname bump - -* Wed Jan 28 2015 Tom Hughes - 1.4.17-5 -- Fixed to build with nan 1.6 - -* Wed Jan 28 2015 Tom Hughes - 1.4.17-4 -- Rebuild for boost 1.57.0 - -* Tue Jan 27 2015 Petr Machata - 1.4.17-3 -- Rebuild for boost 1.57.0 - -* Tue Oct 28 2014 Tom Hughes - 1.4.17-2 -- Loosen mapnik-vector-tile dependency - -* Tue Sep 30 2014 Tom Hughes - 1.4.17-1 -- Update to 1.4.17 upstream release - -* Tue Aug 26 2014 Tom Hughes - 1.4.13-1 -- Update to 1.4.13 upstream release - -* Mon Aug 18 2014 Tom Hughes - 1.4.12-1 -- Update to 1.4.12 upstream release - -* Sun Aug 17 2014 Fedora Release Engineering - 1.4.10-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sun Jun 22 2014 Tom Hughes - 1.4.10-1 -- Update to 1.4.10 upstream release - -* Sat Jun 07 2014 Fedora Release Engineering - 1.4.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Mon May 26 2014 Tom Hughes - 1.4.5-1 -- Update to 1.4.5 upstream release - -* Sat May 24 2014 Petr Machata - 1.4.4-2 -- Rebuild for boost 1.55.0 - -* Fri May 23 2014 Tom Hughes - 1.4.4-1 -- Update to 1.4.4 upstream release - -* Fri May 9 2014 Tom Hughes - 1.4.3-1 -- Update to 1.4.3 upstream release - -* Thu Apr 3 2014 Tom Hughes - 1.4.2-1 -- Update to 1.4.2 upstream release - -* Mon Mar 3 2014 Tom Hughes - 1.4.0-2 -- Remove nodejs-pre-gyp dependency - -* Sun Mar 2 2014 Tom Hughes - 1.4.0-1 -- Update to 1.4.0 upstream release -- Switch to source from github as npm no longer includes tests - -* Fri Feb 28 2014 Tom Hughes - 1.3.4-1 -- Update to 1.3.4 upstream release - -* Wed Feb 26 2014 Tom Hughes - 1.3.2-1 -- Update to 1.3.2 upstream release - -* Sat Feb 22 2014 Tom Hughes - 1.3.1-1 -- Update to 1.3.1 upstream release - -* Wed Feb 19 2014 Tom Hughes - 1.3.0-1 -- Update to 1.3.0 upstream release - -* Fri Feb 14 2014 T.C. Hollingsworth - 1.2.3-2 -- rebuild for icu-53 (via v8) - -* Fri Jan 10 2014 Tom Hughes - 1.2.3-1 -- Update to 1.2.3 upstream release - -* Fri Nov 8 2013 Tom Hughes - 1.2.2-1 -- Update to 1.2.2 upstream release - -* Fri Sep 27 2013 Tom Hughes - 1.2.1-1 -- Update to 1.2.1 upstream release - -* Tue Sep 10 2013 Tom Hughes - 1.2.0-1 -- Update to 1.2.0 upstream release - -* Mon Aug 26 2013 Tom Hughes - 1.1.3-2 -- Don't strip the compiled extension module - -* Fri Aug 16 2013 Tom Hughes - 1.1.3-1 -- Update to 1.1.3 upstream release - -* Sat Aug 03 2013 Fedora Release Engineering - 1.1.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Tue Jul 30 2013 Tom Hughes - 1.1.2-1 -- Update to 1.1.2 upstream release - -* Tue Jul 30 2013 Petr Machata - 1.1.0-3 -- Rebuild for boost 1.54.0 - -* Tue Jul 16 2013 Tom Hughes - 1.1.0-2 -- Correct system font paths - -* Mon Jul 15 2013 Tom Hughes - 1.1.0-1 -- Update to 1.1.0 upstream release -- Remove mapnik-vector-tile from run time dependencies - -* Tue Jul 9 2013 Tom Hughes - 1.0.0-2 -- Add upstream patch for numeric precision issue - -* Fri Jul 5 2013 Tom Hughes - 1.0.0-1 -- Update to 1.0.0 upstream release - -* Sun Feb 10 2013 Tom Hughes - 0.7.22-1 -- Initial build of 0.7.22 diff --git a/sources b/sources deleted file mode 100644 index 92c4ed1..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (nodejs-mapnik-3.7.2.tar.gz) = 06d768337f56e36bbba155aaaac370e39fe7ab3c60fa6a5a51dd239a31dc3f6bee27856146ecda7ea6df7d012e32d84501b6f5f4481e289347f5027fb38731b8