diff --git a/src/mapnik_color.cpp b/src/mapnik_color.cpp index 7d3aec7377..7be4ff23f4 100644 --- a/src/mapnik_color.cpp +++ b/src/mapnik_color.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Color instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_datasource.cpp b/src/mapnik_datasource.cpp index 3973527fe6..881249a27f 100644 --- a/src/mapnik_datasource.cpp +++ b/src/mapnik_datasource.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Datasource instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_feature.cpp b/src/mapnik_feature.cpp index 03258e97f4..d2ac6a188d 100644 --- a/src/mapnik_feature.cpp +++ b/src/mapnik_feature.cpp @@ -114,7 +114,7 @@ NAN_METHOD(Feature::fromJSON) } Feature* feat = new Feature(f); v8::Local ext = Nan::New(feat); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Feature instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_featureset.cpp b/src/mapnik_featureset.cpp index 36c056d8f7..3e1e50aaa2 100644 --- a/src/mapnik_featureset.cpp +++ b/src/mapnik_featureset.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 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_geometry.cpp b/src/mapnik_geometry.cpp index 24d7b08d45..1512c21e79 100644 --- a/src/mapnik_geometry.cpp +++ b/src/mapnik_geometry.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Geometry instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_grid_view.cpp b/src/mapnik_grid_view.cpp index 0ab604cd64..3d66882f0a 100644 --- a/src/mapnik_grid_view.cpp +++ b/src/mapnik_grid_view.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new GridView instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp index f4ed8474ed..19c256098a 100644 --- a/src/mapnik_image.cpp +++ b/src/mapnik_image.cpp @@ -1615,7 +1615,7 @@ void Image::EIO_AfterCopy(uv_work_t* req) { Image* im = new Image(closure->im2); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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); @@ -1734,7 +1734,7 @@ v8::Local Image::_copySync(Nan::NAN_METHOD_ARGS_TYPE info) ); Image* new_im = new Image(imagep); v8::Local ext = Nan::New(new_im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); return scope.Escape(maybe_local.ToLocalChecked()); } @@ -2080,7 +2080,7 @@ void Image::EIO_AfterResize(uv_work_t* req) { Image* im = new Image(closure->im2); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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); @@ -2267,7 +2267,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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); return scope.Escape(maybe_local.ToLocalChecked()); } @@ -2378,7 +2378,7 @@ v8::Local Image::_openSync(Nan::NAN_METHOD_ARGS_TYPE info) } Image* im = new Image(imagep); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); return scope.Escape(maybe_local.ToLocalChecked()); } @@ -2516,7 +2516,7 @@ void Image::EIO_AfterOpen(uv_work_t* req) { Image* im = new Image(closure->im); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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); @@ -2725,7 +2725,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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); return scope.Escape(maybe_local.ToLocalChecked()); } @@ -2963,7 +2963,7 @@ void Image::EIO_AfterFromSVG(uv_work_t* req) { Image* im = new Image(closure->im); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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); @@ -3296,7 +3296,7 @@ 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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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 image_obj = maybe_local.ToLocalChecked()->ToObject(); image_obj->Set(Nan::New("_buffer").ToLocalChecked(),obj); @@ -3352,7 +3352,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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance"); return scope.Escape(maybe_local.ToLocalChecked()); } @@ -3523,7 +3523,7 @@ void Image::EIO_AfterFromBytes(uv_work_t* req) { Image* im = new Image(closure->im); v8::Local ext = Nan::New(im); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + 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); diff --git a/src/mapnik_image_view.cpp b/src/mapnik_image_view.cpp index cfd7b47373..36a18c4b7f 100644 --- a/src/mapnik_image_view.cpp +++ b/src/mapnik_image_view.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new ImageView instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_layer.cpp b/src/mapnik_layer.cpp index a324288676..d58019511c 100644 --- a/src/mapnik_layer.cpp +++ b/src/mapnik_layer.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Layer instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_map.cpp b/src/mapnik_map.cpp index ec4f91f682..a14c5be465 100644 --- a/src/mapnik_map.cpp +++ b/src/mapnik_map.cpp @@ -1456,7 +1456,7 @@ NAN_METHOD(Map::clone) Map* m2 = new Map(); m2->map_ = std::make_shared(*m->map_); v8::Local ext = Nan::New(m2); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Map instance"); else info.GetReturnValue().Set(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_memory_datasource.cpp b/src/mapnik_memory_datasource.cpp index cb87e2a082..3a1c51cd21 100644 --- a/src/mapnik_memory_datasource.cpp +++ b/src/mapnik_memory_datasource.cpp @@ -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); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new MemoryDatasource instance"); return scope.Escape(maybe_local.ToLocalChecked()); } diff --git a/src/mapnik_vector_tile.cpp b/src/mapnik_vector_tile.cpp index dfeee99d39..9fb5e3063d 100644 --- a/src/mapnik_vector_tile.cpp +++ b/src/mapnik_vector_tile.cpp @@ -1396,7 +1396,7 @@ NAN_METHOD(VectorTile::layer) } } v8::Local ext = Nan::New(v); - v8::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); + Nan::MaybeLocal maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext); if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Layer instance"); else info.GetReturnValue().Set(maybe_local.ToLocalChecked()); return;