[Pkg-javascript-devel] Bug#911344: node-mapnik: Patch for nodejs 10 / nan 2.11

Jérémy Lal kapouer at melix.org
Thu Oct 18 21:20:07 BST 2018


Package: node-mapnik
Severity: normal

Hi,

node-mapnik 3.7 does not build against nodejs 10.12 / nan 2.11.
Simple patch attached to fix this.

Jérémy


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8), LANGUAGE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
Description: Port new instance call to match latest node/nan versions
 this patch is backward compatible with previous node/nan versions.
Author: Jérémy Lal <kapouer at melix.org>
Last-Update: 2018-10-18
Forwarded: not-needed, fixed in master

--- a/src/mapnik_image.cpp
+++ b/src/mapnik_image.cpp
@@ -3220,8 +3220,9 @@
     {
         Image* im = new Image(closure->im);
         v8::Local<v8::Value> ext = Nan::New<v8::External>(im);
-        v8::Local<v8::Object> image_obj = Nan::New(constructor)->GetFunction()->NewInstance(1, &ext);
-        v8::Local<v8::Value> argv[2] = { Nan::Null(), image_obj };
+        Nan::MaybeLocal<v8::Object> maybe_local = Nan::NewInstance(Nan::New(constructor)->GetFunction(), 1, &ext);
+        if (maybe_local.IsEmpty()) Nan::ThrowError("Could not create new Image instance");
+        v8::Local<v8::Value> argv[2] = { Nan::Null(), maybe_local.ToLocalChecked() };
         Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(closure->cb), 2, argv);
     }
     closure->cb.Reset();


More information about the Pkg-javascript-devel mailing list