Ppchelko has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/333795 )

Change subject: Update restbase to 5d1d44f
......................................................................


Update restbase to 5d1d44f

List of changes:
463fd7d Specify 'any' license in TFA pageimage request
cfc1670 Added option for 'monthly' granularity in metrics endpoint
1c71783 Log feed only for en.wiki
xxxxxxx Update node module dependencies

Change-Id: I8ce373b06b80a60997674ba940f7bf357542c9f9
---
M node_modules/content-type/package.json
M node_modules/heapdump/build/Makefile
M 
node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
M node_modules/heapdump/build/addon.target.mk
M node_modules/heapdump/build/config.gypi
M node_modules/json-stable-stringify/package.json
M node_modules/kad/package.json
M node_modules/nan/nan.h
M node_modules/nan/nan_callbacks.h
M node_modules/nan/nan_callbacks_12_inl.h
M node_modules/nan/nan_callbacks_pre_12_inl.h
M node_modules/nan/nan_converters.h
M node_modules/nan/nan_converters_43_inl.h
M node_modules/nan/nan_converters_pre_43_inl.h
M node_modules/nan/nan_implementation_12_inl.h
M node_modules/nan/nan_implementation_pre_12_inl.h
M node_modules/nan/nan_maybe_43_inl.h
M node_modules/nan/nan_maybe_pre_43_inl.h
M node_modules/nan/nan_new.h
M node_modules/nan/nan_object_wrap.h
M node_modules/nan/nan_persistent_12_inl.h
M node_modules/nan/nan_persistent_pre_12_inl.h
M node_modules/nan/nan_private.h
M node_modules/nan/nan_typedarray_contents.h
M node_modules/nan/nan_weak.h
M node_modules/nan/package.json
M node_modules/nan/tools/1to2.js
A node_modules/normalize-package-data/test/normalize.js~
M node_modules/swagger-ui/package.json
M restbase
30 files changed, 652 insertions(+), 261 deletions(-)

Approvals:
  Ppchelko: Verified; Looks good to me, approved



diff --git a/node_modules/content-type/package.json 
b/node_modules/content-type/package.json
index a4e8165..b98eea9 100644
--- a/node_modules/content-type/package.json
+++ b/node_modules/content-type/package.json
@@ -49,7 +49,7 @@
     "/"
   ],
   "_resolved": 
"git+https://github.com/wikimedia/content-type.git#47b2632d0a2ee79a7d67268e2f6621becd95d05b";,
-  "_shasum": "ff9dc790d6558b26110898bab39d0c214dc32067",
+  "_shasum": "241a59ae56e1c89aefb2ca6908c9dd3411cf7a20",
   "_shrinkwrap": null,
   "_spec": 
"content-type@git+https://github.com/wikimedia/content-type.git#master";,
   "_where": "/opt/service",
diff --git a/node_modules/heapdump/build/Makefile 
b/node_modules/heapdump/build/Makefile
index 80ab260..2f27e5e 100644
--- a/node_modules/heapdump/build/Makefile
+++ b/node_modules/heapdump/build/Makefile
@@ -308,8 +308,8 @@
 endif
 
 quiet_cmd_regen_makefile = ACTION Regenerating $@
-cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/home/runuser/.node-gyp/6.9.1/include/node/common.gypi "--depth=." 
"-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" 
"-Dvisibility=default" "-Dnode_root_dir=/home/runuser/.node-gyp/6.9.1" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
-Makefile: 
$(srcdir)/../../../../home/runuser/.node-gyp/6.9.1/include/node/common.gypi 
$(srcdir)/../../../../usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
+cmd_regen_makefile = cd $(srcdir); 
/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
 -fmake --ignore-environment "--toplevel-dir=." 
-I/opt/service/node_modules/heapdump/build/config.gypi 
-I/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 -I/root/.node-gyp/6.9.1/include/node/common.gypi "--depth=." "-Goutput_dir=." 
"--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" 
"-Dnode_root_dir=/root/.node-gyp/6.9.1" 
"-Dnode_gyp_dir=/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp"
 "-Dnode_lib_file=node.lib" 
"-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp
+Makefile: 
$(srcdir)/../../../../usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
 $(srcdir)/build/config.gypi $(srcdir)/binding.gyp 
$(srcdir)/../../../../root/.node-gyp/6.9.1/include/node/common.gypi
        $(call do_cmd,regen_makefile)
 
 # "all" is a concatenation of the "all" targets from all the included
diff --git 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
index e043efc..f1c3bd7 100644
--- 
a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
+++ 
b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d
@@ -1,36 +1,34 @@
-cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/home/runuser/.node-gyp/6.9.1/include/node 
-I/home/runuser/.node-gyp/6.9.1/src 
-I/home/runuser/.node-gyp/6.9.1/deps/uv/include 
-I/home/runuser/.node-gyp/6.9.1/deps/v8/include  -fPIC -pthread -Wall -Wextra 
-Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti 
-fno-exceptions -std=gnu++0x -MMD -MF 
./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw   -c -o 
Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc
+cmd_Release/obj.target/addon/src/heapdump.o := g++ 
'-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' 
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
'-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/6.9.1/include/node 
-I/root/.node-gyp/6.9.1/src -I/root/.node-gyp/6.9.1/deps/uv/include 
-I/root/.node-gyp/6.9.1/deps/v8/include  -fPIC -pthread -Wall -Wextra 
-Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti 
-fno-exceptions -std=gnu++0x -MMD -MF 
./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw   -c -o 
Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc
 Release/obj.target/addon/src/heapdump.o: ../src/heapdump.cc \
- /home/runuser/.node-gyp/6.9.1/include/node/node.h \
- /home/runuser/.node-gyp/6.9.1/include/node/v8.h \
- /home/runuser/.node-gyp/6.9.1/include/node/v8-version.h \
- /home/runuser/.node-gyp/6.9.1/include/node/v8config.h \
- /home/runuser/.node-gyp/6.9.1/include/node/node_version.h \
- ../src/compat-inl.h ../src/compat.h \
- /home/runuser/.node-gyp/6.9.1/include/node/node_version.h \
- /home/runuser/.node-gyp/6.9.1/include/node/v8.h \
- /home/runuser/.node-gyp/6.9.1/include/node/v8-profiler.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv-errno.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv-version.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv-unix.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv-threadpool.h \
- /home/runuser/.node-gyp/6.9.1/include/node/uv-linux.h \
- ../src/heapdump-posix.h
+ /root/.node-gyp/6.9.1/include/node/node.h \
+ /root/.node-gyp/6.9.1/include/node/v8.h \
+ /root/.node-gyp/6.9.1/include/node/v8-version.h \
+ /root/.node-gyp/6.9.1/include/node/v8config.h \
+ /root/.node-gyp/6.9.1/include/node/node_version.h ../src/compat-inl.h \
+ ../src/compat.h /root/.node-gyp/6.9.1/include/node/node_version.h \
+ /root/.node-gyp/6.9.1/include/node/v8.h \
+ /root/.node-gyp/6.9.1/include/node/v8-profiler.h \
+ /root/.node-gyp/6.9.1/include/node/uv.h \
+ /root/.node-gyp/6.9.1/include/node/uv-errno.h \
+ /root/.node-gyp/6.9.1/include/node/uv-version.h \
+ /root/.node-gyp/6.9.1/include/node/uv-unix.h \
+ /root/.node-gyp/6.9.1/include/node/uv-threadpool.h \
+ /root/.node-gyp/6.9.1/include/node/uv-linux.h ../src/heapdump-posix.h
 ../src/heapdump.cc:
-/home/runuser/.node-gyp/6.9.1/include/node/node.h:
-/home/runuser/.node-gyp/6.9.1/include/node/v8.h:
-/home/runuser/.node-gyp/6.9.1/include/node/v8-version.h:
-/home/runuser/.node-gyp/6.9.1/include/node/v8config.h:
-/home/runuser/.node-gyp/6.9.1/include/node/node_version.h:
+/root/.node-gyp/6.9.1/include/node/node.h:
+/root/.node-gyp/6.9.1/include/node/v8.h:
+/root/.node-gyp/6.9.1/include/node/v8-version.h:
+/root/.node-gyp/6.9.1/include/node/v8config.h:
+/root/.node-gyp/6.9.1/include/node/node_version.h:
 ../src/compat-inl.h:
 ../src/compat.h:
-/home/runuser/.node-gyp/6.9.1/include/node/node_version.h:
-/home/runuser/.node-gyp/6.9.1/include/node/v8.h:
-/home/runuser/.node-gyp/6.9.1/include/node/v8-profiler.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv-errno.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv-version.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv-unix.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv-threadpool.h:
-/home/runuser/.node-gyp/6.9.1/include/node/uv-linux.h:
+/root/.node-gyp/6.9.1/include/node/node_version.h:
+/root/.node-gyp/6.9.1/include/node/v8.h:
+/root/.node-gyp/6.9.1/include/node/v8-profiler.h:
+/root/.node-gyp/6.9.1/include/node/uv.h:
+/root/.node-gyp/6.9.1/include/node/uv-errno.h:
+/root/.node-gyp/6.9.1/include/node/uv-version.h:
+/root/.node-gyp/6.9.1/include/node/uv-unix.h:
+/root/.node-gyp/6.9.1/include/node/uv-threadpool.h:
+/root/.node-gyp/6.9.1/include/node/uv-linux.h:
 ../src/heapdump-posix.h:
diff --git a/node_modules/heapdump/build/addon.target.mk 
b/node_modules/heapdump/build/addon.target.mk
index 3531fef..a08c6df 100644
--- a/node_modules/heapdump/build/addon.target.mk
+++ b/node_modules/heapdump/build/addon.target.mk
@@ -34,10 +34,10 @@
        -std=gnu++0x
 
 INCS_Debug := \
-       -I/home/runuser/.node-gyp/6.9.1/include/node \
-       -I/home/runuser/.node-gyp/6.9.1/src \
-       -I/home/runuser/.node-gyp/6.9.1/deps/uv/include \
-       -I/home/runuser/.node-gyp/6.9.1/deps/v8/include
+       -I/root/.node-gyp/6.9.1/include/node \
+       -I/root/.node-gyp/6.9.1/src \
+       -I/root/.node-gyp/6.9.1/deps/uv/include \
+       -I/root/.node-gyp/6.9.1/deps/v8/include
 
 DEFS_Release := \
        '-DNODE_GYP_MODULE_NAME=addon' \
@@ -69,10 +69,10 @@
        -std=gnu++0x
 
 INCS_Release := \
-       -I/home/runuser/.node-gyp/6.9.1/include/node \
-       -I/home/runuser/.node-gyp/6.9.1/src \
-       -I/home/runuser/.node-gyp/6.9.1/deps/uv/include \
-       -I/home/runuser/.node-gyp/6.9.1/deps/v8/include
+       -I/root/.node-gyp/6.9.1/include/node \
+       -I/root/.node-gyp/6.9.1/src \
+       -I/root/.node-gyp/6.9.1/deps/uv/include \
+       -I/root/.node-gyp/6.9.1/deps/v8/include
 
 OBJS := \
        $(obj).target/$(TARGET)/src/heapdump.o
diff --git a/node_modules/heapdump/build/config.gypi 
b/node_modules/heapdump/build/config.gypi
index f36a239..4f0311d 100644
--- a/node_modules/heapdump/build/config.gypi
+++ b/node_modules/heapdump/build/config.gypi
@@ -57,7 +57,7 @@
     "v8_random_seed": 0,
     "v8_use_snapshot": "true",
     "want_separate_host_toolset": 0,
-    "nodedir": "/home/runuser/.node-gyp/6.9.1",
+    "nodedir": "/root/.node-gyp/6.9.1",
     "copy_dev_lib": "true",
     "standalone_static_library": 1,
     "cache_lock_stale": "60000",
@@ -81,7 +81,7 @@
     "rollback": "true",
     "tag_version_prefix": "v",
     "cache_max": "Infinity",
-    "userconfig": "/home/runuser/.npmrc",
+    "userconfig": "/root/.npmrc",
     "engine_strict": "",
     "init_author_name": "",
     "init_author_url": "",
@@ -104,7 +104,7 @@
     "scope": "",
     "searchopts": "",
     "versions": "",
-    "cache": "/home/runuser/.npm",
+    "cache": "/root/.npm",
     "global_style": "",
     "ignore_scripts": "",
     "searchsort": "name",
@@ -127,7 +127,7 @@
     "unicode": "",
     "long": "",
     "production": "",
-    "unsafe_perm": "true",
+    "unsafe_perm": "",
     "node_version": "6.9.1",
     "tag": "latest",
     "git_tag_version": "true",
@@ -139,12 +139,12 @@
     "strict_ssl": "true",
     "dev": "",
     "globalconfig": "/usr/local/nvm/versions/node/v6.9.1/etc/npmrc",
-    "init_module": "/home/runuser/.npm-init.js",
+    "init_module": "/root/.npm-init.js",
     "parseable": "",
     "globalignorefile": "/usr/local/nvm/versions/node/v6.9.1/etc/npmignore",
     "cache_lock_retries": "10",
     "save_prefix": "^",
-    "group": "1000",
+    "group": "",
     "init_author_email": "",
     "searchexclude": "",
     "git": "git",
diff --git a/node_modules/json-stable-stringify/package.json 
b/node_modules/json-stable-stringify/package.json
index 13170fe..ac4ff64 100644
--- a/node_modules/json-stable-stringify/package.json
+++ b/node_modules/json-stable-stringify/package.json
@@ -51,7 +51,7 @@
     "/restbase-mod-table-cassandra"
   ],
   "_resolved": 
"git+https://github.com/wikimedia/json-stable-stringify.git#c05178e4dfc3834017f017732934c1c52ba3dd8f";,
-  "_shasum": "4482fc68e97ea9d8d9baa9c42f70ce0214c46e75",
+  "_shasum": "3f0b6d3c4c2082e1baedf4c7fbdf9e5c8e629f43",
   "_shrinkwrap": null,
   "_spec": 
"json-stable-stringify@git+https://github.com/wikimedia/json-stable-stringify.git#master";,
   "_where": "/opt/service",
diff --git a/node_modules/kad/package.json b/node_modules/kad/package.json
index 000aeca..84ac6d8 100644
--- a/node_modules/kad/package.json
+++ b/node_modules/kad/package.json
@@ -49,7 +49,7 @@
     "/limitation"
   ],
   "_resolved": 
"git+https://github.com/gwicke/kad.git#f35971036f43814043245da82b12d035b7bbfd16";,
-  "_shasum": "4bf75dc31d2dd202868a5026e0a28f54b6ee3c48",
+  "_shasum": "8a6985bc397404cee47482e8fc10d1598dc55710",
   "_shrinkwrap": null,
   "_spec": "kad@git+https://github.com/gwicke/kad.git#master";,
   "_where": "/opt/service/node_modules/limitation",
diff --git a/node_modules/nan/nan.h b/node_modules/nan/nan.h
index 1e8ac7f..aed2b31 100644
--- a/node_modules/nan/nan.h
+++ b/node_modules/nan/nan.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors:
+ * Copyright (c) 2017 NAN contributors:
  *   - Rod Vagg <https://github.com/rvagg>
  *   - Benjamin Byholm <https://github.com/kkoopa>
  *   - Trevor Norris <https://github.com/trevnorris>
@@ -12,7 +12,7 @@
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  *
- * Version 2.5.0: current Node 7.3.0, Node 12: 0.12.18, Node 10: 0.10.48, 
iojs: 3.3.1
+ * Version 2.5.1: current Node 7.4.0, Node 12: 0.12.18, Node 10: 0.10.48, 
iojs: 3.3.1
  *
  * See https://github.com/nodejs/nan for the latest update to this file
  
**********************************************************************************/
@@ -429,11 +429,14 @@
 #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      
\
   (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 
3))
   inline v8::MaybeLocal<v8::Value> StackTrace() const {
-    return try_catch_.StackTrace(GetCurrentContext());
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(try_catch_.StackTrace(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
   }
 #else
   inline MaybeLocal<v8::Value> StackTrace() const {
-    return MaybeLocal<v8::Value>(try_catch_.StackTrace());
+    return try_catch_.StackTrace();
   }
 #endif
 
@@ -634,23 +637,23 @@
   }
 
 # define X(NAME)                                                               
\
-    inline v8::Local<v8::Value> NAME(const char *msg) {                    \
+    inline v8::Local<v8::Value> NAME(const char *msg) {                        
\
       EscapableHandleScope scope;                                              
\
       return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked()));     
\
     }                                                                          
\
                                                                                
\
-    inline                                                                 \
+    inline                                                                     
\
     v8::Local<v8::Value> NAME(v8::Local<v8::String> msg) {                     
\
       return v8::Exception::NAME(msg);                                         
\
     }                                                                          
\
                                                                                
\
-    inline void Throw ## NAME(const char *msg) {                           \
+    inline void Throw ## NAME(const char *msg) {                               
\
       HandleScope scope;                                                       
\
       v8::Isolate::GetCurrent()->ThrowException(                               
\
           v8::Exception::NAME(New(msg).ToLocalChecked()));                     
\
     }                                                                          
\
                                                                                
\
-    inline void Throw ## NAME(v8::Local<v8::String> msg) {                 \
+    inline void Throw ## NAME(v8::Local<v8::String> msg) {                     
\
       HandleScope scope;                                                       
\
       v8::Isolate::GetCurrent()->ThrowException(                               
\
           v8::Exception::NAME(msg));                                           
\
@@ -685,8 +688,8 @@
     return node::Buffer::New(
         v8::Isolate::GetCurrent(), data, length, callback, hint);
 #else
-    return MaybeLocal<v8::Object>(node::Buffer::New(
-        v8::Isolate::GetCurrent(), data, length, callback, hint));
+    return node::Buffer::New(v8::Isolate::GetCurrent(), data, length, callback,
+                             hint);
 #endif
   }
 
@@ -701,8 +704,7 @@
     return node::Buffer::Copy(
         v8::Isolate::GetCurrent(), data, size);
 #else
-    return MaybeLocal<v8::Object>(node::Buffer::New(
-        v8::Isolate::GetCurrent(), data, size));
+    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
 #endif
   }
 
@@ -714,8 +716,7 @@
     return node::Buffer::New(
         v8::Isolate::GetCurrent(), size);
 #else
-    return MaybeLocal<v8::Object>(node::Buffer::New(
-        v8::Isolate::GetCurrent(), size));
+    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
 #endif
   }
 
@@ -729,8 +730,7 @@
 #if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
 #else
-    return MaybeLocal<v8::Object>(
-        node::Buffer::Use(v8::Isolate::GetCurrent(), data, size));
+    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
 #endif
   }
 
@@ -746,36 +746,48 @@
       v8::Local<v8::String> s
     , const v8::ScriptOrigin& origin
   ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
     v8::ScriptCompiler::Source source(s, origin);
-    return v8::ScriptCompiler::Compile(GetCurrentContext(), &source);
+    return scope.Escape(
+        v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source)
+            .FromMaybe(v8::Local<BoundScript>()));
   }
 
   inline MaybeLocal<BoundScript> CompileScript(
       v8::Local<v8::String> s
   ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
     v8::ScriptCompiler::Source source(s);
-    return v8::ScriptCompiler::Compile(GetCurrentContext(), &source);
+    return scope.Escape(
+        v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source)
+            .FromMaybe(v8::Local<BoundScript>()));
   }
 
   inline MaybeLocal<v8::Value> RunScript(
       v8::Local<UnboundScript> script
   ) {
-    return script->BindToCurrentContext()->Run(GetCurrentContext());
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(script->BindToCurrentContext()
+                            ->Run(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
   }
 
   inline MaybeLocal<v8::Value> RunScript(
       v8::Local<BoundScript> script
   ) {
-    return script->Run(GetCurrentContext());
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(script->Run(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
   }
 #else
   inline MaybeLocal<v8::String>
   NewOneByteString(const uint8_t * value, int length = -1) {
-    return MaybeLocal<v8::String>(
-        v8::String::NewFromOneByte(
-            v8::Isolate::GetCurrent()
-          , value
-          , v8::String::kNormalString, length));
+    return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value,
+                                      v8::String::kNormalString, length);
   }
 
   inline MaybeLocal<BoundScript> CompileScript(
@@ -783,28 +795,27 @@
     , const v8::ScriptOrigin& origin
   ) {
     v8::ScriptCompiler::Source source(s, origin);
-    return MaybeLocal<BoundScript>(
-        v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source));
+    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
   }
 
   inline MaybeLocal<BoundScript> CompileScript(
       v8::Local<v8::String> s
   ) {
     v8::ScriptCompiler::Source source(s);
-    return MaybeLocal<BoundScript>(
-        v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source));
+    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
   }
 
   inline MaybeLocal<v8::Value> RunScript(
       v8::Local<UnboundScript> script
   ) {
-    return MaybeLocal<v8::Value>(script->BindToCurrentContext()->Run());
+    EscapableHandleScope scope;
+    return scope.Escape(script->BindToCurrentContext()->Run());
   }
 
   inline MaybeLocal<v8::Value> RunScript(
       v8::Local<BoundScript> script
   ) {
-    return MaybeLocal<v8::Value>(script->Run());
+    return script->Run();
   }
 #endif
 
@@ -814,8 +825,9 @@
     , int argc
     , v8::Local<v8::Value>* argv) {
 #if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
-    return New(node::MakeCallback(
-        v8::Isolate::GetCurrent(), target, func, argc, argv));
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, func, argc, argv)));
 #else
     return node::MakeCallback(
         v8::Isolate::GetCurrent(), target, func, argc, argv);
@@ -828,8 +840,9 @@
     , int argc
     , v8::Local<v8::Value>* argv) {
 #if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
-    return New(node::MakeCallback(
-        v8::Isolate::GetCurrent(), target, symbol, argc, argv));
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, symbol, argc, argv)));
 #else
     return node::MakeCallback(
         v8::Isolate::GetCurrent(), target, symbol, argc, argv);
@@ -842,8 +855,9 @@
     , int argc
     , v8::Local<v8::Value>* argv) {
 #if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
-    return New(node::MakeCallback(
-        v8::Isolate::GetCurrent(), target, method, argc, argv));
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, method, argc, argv)));
 #else
     return node::MakeCallback(
         v8::Isolate::GetCurrent(), target, method, argc, argv);
@@ -890,6 +904,7 @@
  public:
   inline explicit Utf8String(v8::Local<v8::Value> from) :
       length_(0), str_(str_st_) {
+    HandleScope scope;
     if (!from.IsEmpty()) {
       v8::Local<v8::String> string = from->ToString();
       if (!string.IsEmpty()) {
@@ -1016,23 +1031,24 @@
   }
 
 # define X(NAME)                                                               
\
-    inline v8::Local<v8::Value> NAME(const char *msg) {                    \
+    inline v8::Local<v8::Value> NAME(const char *msg) {                        
\
       EscapableHandleScope scope;                                              
\
       return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked()));     
\
     }                                                                          
\
                                                                                
\
-    inline                                                                 \
+    inline                                                                     
\
     v8::Local<v8::Value> NAME(v8::Local<v8::String> msg) {                     
\
       return v8::Exception::NAME(msg);                                         
\
     }                                                                          
\
                                                                                
\
-    inline void Throw ## NAME(const char *msg) {                           \
+    inline void Throw ## NAME(const char *msg) {                               
\
       HandleScope scope;                                                       
\
       v8::ThrowException(v8::Exception::NAME(New(msg).ToLocalChecked()));      
\
     }                                                                          
\
                                                                                
\
-    inline                                                                 \
+    inline                                                                     
\
     void Throw ## NAME(v8::Local<v8::String> errmsg) {                         
\
+      HandleScope scope;                                                       
\
       v8::ThrowException(v8::Exception::NAME(errmsg));                         
\
     }
 
@@ -1058,8 +1074,8 @@
     // arbitrary buffer lengths requires
     // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
     assert(length <= imp::kMaxLength && "too large buffer");
-    return MaybeLocal<v8::Object>(scope.Escape(
-        New(node::Buffer::New(data, length, callback, hint)->handle_)));
+    return scope.Escape(
+        New(node::Buffer::New(data, length, callback, hint)->handle_));
   }
 
   inline MaybeLocal<v8::Object> CopyBuffer(
@@ -1071,11 +1087,10 @@
     // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
     assert(size <= imp::kMaxLength && "too large buffer");
 #if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION
-    return MaybeLocal<v8::Object>(
-        scope.Escape(New(node::Buffer::New(data, size)->handle_)));
+    return scope.Escape(New(node::Buffer::New(data, size)->handle_));
 #else
-    return MaybeLocal<v8::Object>(scope.Escape(
-        New(node::Buffer::New(const_cast<char*>(data), size)->handle_)));
+    return scope.Escape(
+        New(node::Buffer::New(const_cast<char *>(data), size)->handle_));
 #endif
   }
 
@@ -1084,8 +1099,7 @@
     // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
     EscapableHandleScope scope;
     assert(size <= imp::kMaxLength && "too large buffer");
-    return MaybeLocal<v8::Object>(
-        scope.Escape(New(node::Buffer::New(size)->handle_)));
+    return scope.Escape(New(node::Buffer::New(size)->handle_));
   }
 
   inline void FreeData(char *data, void *hint) {
@@ -1101,8 +1115,8 @@
     // arbitrary buffer lengths requires
     // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
     assert(size <= imp::kMaxLength && "too large buffer");
-    return MaybeLocal<v8::Object>(scope.Escape(New(
-        node::Buffer::New(data, size, FreeData, NULL)->handle_)));
+    return scope.Escape(
+        New(node::Buffer::New(data, size, FreeData, NULL)->handle_));
   }
 
 namespace imp {
@@ -1122,27 +1136,26 @@
   NewOneByteString(const uint8_t * value, int length = -1) {
     std::vector<uint16_t> wideString;  // NOLINT(build/include_what_you_use)
     imp::widenString(&wideString, value, length);
-    return imp::Factory<v8::String>::return_t(v8::String::New(
-        &wideString.front(), static_cast<int>(wideString.size())));
+    return v8::String::New(wideString.data(),
+                           static_cast<int>(wideString.size()));
   }
 
   inline MaybeLocal<BoundScript> CompileScript(
       v8::Local<v8::String> s
     , const v8::ScriptOrigin& origin
   ) {
-    return MaybeLocal<BoundScript>(
-        v8::Script::Compile(s, const_cast<v8::ScriptOrigin *>(&origin)));
+    return v8::Script::Compile(s, const_cast<v8::ScriptOrigin *>(&origin));
   }
 
   inline MaybeLocal<BoundScript> CompileScript(
     v8::Local<v8::String> s
   ) {
-    return MaybeLocal<BoundScript>(v8::Script::Compile(s));
+    return v8::Script::Compile(s);
   }
 
   inline
   MaybeLocal<v8::Value> RunScript(v8::Local<v8::Script> script) {
-    return MaybeLocal<v8::Value>(script->Run());
+    return script->Run();
   }
 
   inline v8::Local<v8::Value> MakeCallback(
@@ -1150,7 +1163,8 @@
     , v8::Local<v8::Function> func
     , int argc
     , v8::Local<v8::Value>* argv) {
-    return New(node::MakeCallback(target, func, argc, argv));
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, func, argc, argv)));
   }
 
   inline v8::Local<v8::Value> MakeCallback(
@@ -1158,7 +1172,8 @@
     , v8::Local<v8::String> symbol
     , int argc
     , v8::Local<v8::Value>* argv) {
-    return New(node::MakeCallback(target, symbol, argc, argv));
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, symbol, argc, argv)));
   }
 
   inline v8::Local<v8::Value> MakeCallback(
@@ -1166,7 +1181,8 @@
     , const char* method
     , int argc
     , v8::Local<v8::Value>* argv) {
-    return New(node::MakeCallback(target, method, argc, argv));
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, method, argc, argv)));
   }
 
   inline void FatalException(const TryCatch& try_catch) {
@@ -1209,6 +1225,7 @@
  public:
   inline explicit Utf8String(v8::Local<v8::Value> from) :
       length_(0), str_(str_st_) {
+    v8::HandleScope scope;
     if (!from.IsEmpty()) {
       v8::Local<v8::String> string = from->ToString();
       if (!string.IsEmpty()) {
@@ -1421,9 +1438,12 @@
   Call(int argc, v8::Local<v8::Value> argv[]) const {
 #if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
     v8::Isolate *isolate = v8::Isolate::GetCurrent();
-    return Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv);
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(
+        Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv));
 #else
-    return Call_(v8::Context::GetCurrent()->Global(), argc, argv);
+    v8::HandleScope scope;
+    return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv));
 #endif
   }
 
@@ -1553,6 +1573,8 @@
   Callback *callback;
 
   virtual void HandleOKCallback() {
+    HandleScope scope;
+
     callback->Call(0, NULL);
   }
 
@@ -1819,6 +1841,7 @@
   , const char *name
   , v8::Local<v8::Data> value
 ) {
+  HandleScope scope;
   SetTemplate(templ->PrototypeTemplate(), name, value);
 }
 
@@ -1828,6 +1851,7 @@
   , v8::Local<v8::Data> value
   , v8::PropertyAttribute attributes
 ) {
+  HandleScope scope;
   SetTemplate(templ->PrototypeTemplate(), name, value, attributes);
 }
 
@@ -1836,6 +1860,7 @@
   , const char *name
   , v8::Local<v8::Data> value
 ) {
+  HandleScope scope;
   SetTemplate(templ->InstanceTemplate(), name, value);
 }
 
@@ -1845,6 +1870,7 @@
   , v8::Local<v8::Data> value
   , v8::PropertyAttribute attributes
 ) {
+  HandleScope scope;
   SetTemplate(templ->InstanceTemplate(), name, value, attributes);
 }
 
@@ -1957,7 +1983,7 @@
   , v8::Local<v8::Value> data = v8::Local<v8::Value>()
   , v8::AccessControl settings = v8::DEFAULT
   , v8::PropertyAttribute attribute = v8::None) {
-  EscapableHandleScope scope;
+  HandleScope scope;
 
   imp::NativeGetter getter_ =
       imp::GetterCallbackWrapper;
@@ -2203,6 +2229,8 @@
 void
 Export(ADDON_REGISTER_FUNCTION_ARGS_TYPE target, const char *name,
     FunctionCallback f) {
+  HandleScope scope;
+
   Set(target, New<v8::String>(name).ToLocalChecked(),
       GetFunction(New<v8::FunctionTemplate>(f)).ToLocalChecked());
 }
@@ -2211,17 +2239,21 @@
 
 struct Tap {
   explicit Tap(v8::Local<v8::Value> t) : t_() {
+    HandleScope scope;
+
     t_.Reset(To<v8::Object>(t).ToLocalChecked());
   }
 
   ~Tap() { t_.Reset(); }  // not sure if neccessary
 
   inline void plan(int i) {
+    HandleScope scope;
     v8::Local<v8::Value> arg = New(i);
     MakeCallback(New(t_), "plan", 1, &arg);
   }
 
   inline void ok(bool isOk, const char *msg = NULL) {
+    HandleScope scope;
     v8::Local<v8::Value> args[2];
     args[0] = New(isOk);
     if (msg) args[1] = New(msg).ToLocalChecked();
@@ -2229,6 +2261,7 @@
   }
 
   inline void pass(const char * msg = NULL) {
+    HandleScope scope;
     v8::Local<v8::Value> hmsg;
     if (msg) hmsg = New(msg).ToLocalChecked();
     MakeCallback(New(t_), "pass", msg ? 1 : 0, &hmsg);
@@ -2254,13 +2287,13 @@
 template <typename T> struct Maybefier;
 
 template <typename T> struct Maybefier<v8::Local<T> > {
-  static MaybeLocal<T> convert(v8::Local<T> v) {
-    return MaybeLocal<T>(v);
+  inline static MaybeLocal<T> convert(v8::Local<T> v) {
+    return v;
   }
 };
 
 template <typename T> struct Maybefier<MaybeLocal<T> > {
-  static MaybeLocal<T> convert(MaybeLocal<T> v) {
+  inline static MaybeLocal<T> convert(MaybeLocal<T> v) {
     return v;
   }
 };
@@ -2268,7 +2301,7 @@
 }  // end of namespace imp
 
 template <typename T, template <typename> class MaybeMaybe>
-MaybeLocal<T>
+inline MaybeLocal<T>
 MakeMaybe(MaybeMaybe<T> v) {
   return imp::Maybefier<MaybeMaybe<T> >::convert(v);
 }
diff --git a/node_modules/nan/nan_callbacks.h b/node_modules/nan/nan_callbacks.h
index 851509f..c612cee 100644
--- a/node_modules/nan/nan_callbacks.h
+++ b/node_modules/nan/nan_callbacks.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_callbacks_12_inl.h 
b/node_modules/nan/nan_callbacks_12_inl.h
index bea12c7..9c8bf7e 100644
--- a/node_modules/nan/nan_callbacks_12_inl.h
+++ b/node_modules/nan/nan_callbacks_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_callbacks_pre_12_inl.h 
b/node_modules/nan/nan_callbacks_pre_12_inl.h
index 5e2b8e2..087ee52 100644
--- a/node_modules/nan/nan_callbacks_pre_12_inl.h
+++ b/node_modules/nan/nan_callbacks_pre_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -45,24 +45,32 @@
 
   // Fast primitive setters
   inline void Set(bool value) {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Boolean);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Boolean::New(value));
   }
 
   inline void Set(double i) {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Number);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Number::New(i));
   }
 
   inline void Set(int32_t i) {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Integer);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Int32::New(i));
   }
 
   inline void Set(uint32_t i) {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Integer);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Uint32::NewFromUnsigned(i));
@@ -70,18 +78,24 @@
 
   // Fast JS primitive setters
   inline void SetNull() {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Primitive);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Null());
   }
 
   inline void SetUndefined() {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::Primitive);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::Undefined());
   }
 
   inline void SetEmptyString() {
+    v8::HandleScope scope;
+
     TYPE_CHECK(T, v8::String);
     value_->Dispose();
     *value_ = v8::Persistent<T>::New(v8::String::Empty());
diff --git a/node_modules/nan/nan_converters.h 
b/node_modules/nan/nan_converters.h
index 7386c3b..9dbd1ec 100644
--- a/node_modules/nan/nan_converters.h
+++ b/node_modules/nan/nan_converters.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_converters_43_inl.h 
b/node_modules/nan/nan_converters_43_inl.h
index e2eb032..0c7cd50 100644
--- a/node_modules/nan/nan_converters_43_inl.h
+++ b/node_modules/nan/nan_converters_43_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -12,7 +12,11 @@
 #define X(TYPE)                                                                
\
 imp::ToFactory<v8::TYPE>::return_t                                             
\
 imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) {                  
\
-  return val->To ## TYPE(GetCurrentContext());                                 
\
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            
\
+  v8::EscapableHandleScope scope(isolate);                                     
\
+  return scope.Escape(                                                         
\
+      val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())          
\
+          .FromMaybe(v8::Local<v8::TYPE>()));                                  
\
 }
 
 X(Boolean)
@@ -28,7 +32,9 @@
 #define X(TYPE, NAME)                                                          
\
 imp::ToFactory<TYPE>::return_t                                                 
\
 imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) {                      
\
-  return val->NAME ## Value(GetCurrentContext());                              
\
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            
\
+  v8::HandleScope scope(isolate);                                              
\
+  return val->NAME ## Value(isolate->GetCurrentContext());                     
\
 }
 
 X(bool, Boolean)
diff --git a/node_modules/nan/nan_converters_pre_43_inl.h 
b/node_modules/nan/nan_converters_pre_43_inl.h
index 177a74a..3391be2 100644
--- a/node_modules/nan/nan_converters_pre_43_inl.h
+++ b/node_modules/nan/nan_converters_pre_43_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -12,7 +12,7 @@
 #define X(TYPE)                                                                
\
 imp::ToFactory<v8::TYPE>::return_t                                             
\
 imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) {                  
\
-  return MaybeLocal<v8::TYPE>(val->To ## TYPE());                              
\
+  return val->To ## TYPE();                                                    
\
 }
 
 X(Boolean)
@@ -28,7 +28,7 @@
 #define X(TYPE, NAME)                                                          
\
 imp::ToFactory<TYPE>::return_t                                                 
\
 imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) {                      
\
-  return Just<TYPE>(val->NAME ##Value());                                      
\
+  return Just(val->NAME ## Value());                                           
\
 }
 
 X(bool, Boolean)
diff --git a/node_modules/nan/nan_implementation_12_inl.h 
b/node_modules/nan/nan_implementation_12_inl.h
index be50fc6..be80a45 100644
--- a/node_modules/nan/nan_implementation_12_inl.h
+++ b/node_modules/nan/nan_implementation_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -60,19 +60,15 @@
   (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 
3))
 Factory<v8::Date>::return_t
 Factory<v8::Date>::New(double value) {
-  v8::Local<v8::Date> ret;
-  if (v8::Date::New(GetCurrentContext(), value).
-      ToLocal(reinterpret_cast<v8::Local<v8::Value>*>(&ret))) {
-    return v8::MaybeLocal<v8::Date>(ret);
-  } else {
-    return v8::MaybeLocal<v8::Date>(ret);
-  }
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(v8::Date::New(isolate->GetCurrentContext(), value)
+      .FromMaybe(v8::Local<v8::Value>()).As<v8::Date>());
 }
 #else
 Factory<v8::Date>::return_t
 Factory<v8::Date>::New(double value) {
-  return Factory<v8::Date>::return_t(
-      v8::Date::New(v8::Isolate::GetCurrent(), value).As<v8::Date>());
+  return v8::Date::New(v8::Isolate::GetCurrent(), value).As<v8::Date>();
 }
 #endif
 
@@ -203,14 +199,18 @@
 Factory<v8::RegExp>::New(
     v8::Local<v8::String> pattern
   , v8::RegExp::Flags flags) {
-  return v8::RegExp::New(GetCurrentContext(), pattern, flags);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      v8::RegExp::New(isolate->GetCurrentContext(), pattern, flags)
+          .FromMaybe(v8::Local<v8::RegExp>()));
 }
 #else
 Factory<v8::RegExp>::return_t
 Factory<v8::RegExp>::New(
     v8::Local<v8::String> pattern
   , v8::RegExp::Flags flags) {
-  return Factory<v8::RegExp>::return_t(v8::RegExp::New(pattern, flags));
+  return v8::RegExp::New(pattern, flags);
 }
 #endif
 
@@ -220,30 +220,36 @@
   (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 
3))
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
   v8::ScriptCompiler::Source src(source);
-  return v8::ScriptCompiler::Compile(GetCurrentContext(), &src);
+  return scope.Escape(
+      v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src)
+          .FromMaybe(v8::Local<v8::Script>()));
 }
 
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source
                         , v8::ScriptOrigin const& origin) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
   v8::ScriptCompiler::Source src(source, origin);
-  return v8::ScriptCompiler::Compile(GetCurrentContext(), &src);
+  return scope.Escape(
+      v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src)
+          .FromMaybe(v8::Local<v8::Script>()));
 }
 #else
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source) {
   v8::ScriptCompiler::Source src(source);
-  return Factory<v8::Script>::return_t(
-      v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src));
+  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
 }
 
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source
                         , v8::ScriptOrigin const& origin) {
   v8::ScriptCompiler::Source src(source, origin);
-  return Factory<v8::Script>::return_t(
-      v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src));
+  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
 }
 #endif
 
@@ -258,8 +264,7 @@
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New() {
-  return Factory<v8::String>::return_t(
-      v8::String::Empty(v8::Isolate::GetCurrent()));
+  return v8::String::Empty(v8::Isolate::GetCurrent());
 }
 
 #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      
\
@@ -295,46 +300,33 @@
 #else
 Factory<v8::String>::return_t
 Factory<v8::String>::New(const char * value, int length) {
-  return Factory<v8::String>::return_t(
-      v8::String::NewFromUtf8(
-          v8::Isolate::GetCurrent()
-        , value
-        , v8::String::kNormalString
-        , length));
+  return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value,
+                                 v8::String::kNormalString, length);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(
     std::string const& value) /* NOLINT(build/include_what_you_use) */ {
   assert(value.size() <= INT_MAX && "string too long");
-  return Factory<v8::String>::return_t(
-      v8::String::NewFromUtf8(
-          v8::Isolate::GetCurrent()
-        , value.data()
-        , v8::String::kNormalString
-        , static_cast<int>(value.size())));
+  return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(),
+                                 v8::String::kNormalString,
+                                 static_cast<int>(value.size()));
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(const uint16_t * value, int length) {
-  return Factory<v8::String>::return_t(
-      v8::String::NewFromTwoByte(
-          v8::Isolate::GetCurrent()
-        , value
-        , v8::String::kNormalString
-        , length));
+  return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value,
+                                    v8::String::kNormalString, length);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
-  return Factory<v8::String>::return_t(
-      v8::String::NewExternal(v8::Isolate::GetCurrent(), value));
+  return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(ExternalOneByteStringResource * value) {
-  return Factory<v8::String>::return_t(
-      v8::String::NewExternal(v8::Isolate::GetCurrent(), value));
+  return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
 }
 #endif
 
@@ -367,16 +359,14 @@
 Factory<v8::UnboundScript>::return_t
 Factory<v8::UnboundScript>::New(v8::Local<v8::String> source) {
   v8::ScriptCompiler::Source src(source);
-  return Factory<v8::UnboundScript>::return_t(
-      v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src));
+  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
 }
 
 Factory<v8::UnboundScript>::return_t
 Factory<v8::UnboundScript>::New( v8::Local<v8::String> source
                                , v8::ScriptOrigin const& origin) {
   v8::ScriptCompiler::Source src(source, origin);
-  return Factory<v8::UnboundScript>::return_t(
-      v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src));
+  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
 }
 #endif
 
diff --git a/node_modules/nan/nan_implementation_pre_12_inl.h 
b/node_modules/nan/nan_implementation_pre_12_inl.h
index f6642ee..6afe94c 100644
--- a/node_modules/nan/nan_implementation_pre_12_inl.h
+++ b/node_modules/nan/nan_implementation_pre_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -57,7 +57,7 @@
 
 Factory<v8::Date>::return_t
 Factory<v8::Date>::New(double value) {
-  return Factory<v8::Date>::return_t(v8::Date::New(value).As<v8::Date>());
+  return v8::Date::New(value).As<v8::Date>();
 }
 
 //=== External 
=================================================================
@@ -72,10 +72,11 @@
 Factory<v8::Function>::return_t
 Factory<v8::Function>::New( FunctionCallback callback
                           , v8::Local<v8::Value> data) {
-  return Factory<v8::FunctionTemplate>::New( callback
-                                           , data
-                                           , v8::Local<v8::Signature>()
-                                           )->GetFunction();
+  v8::HandleScope scope;
+
+  return scope.Close(Factory<v8::FunctionTemplate>::New(
+                         callback, data, v8::Local<v8::Signature>())
+                         ->GetFunction());
 }
 
 
@@ -172,20 +173,19 @@
 Factory<v8::RegExp>::New(
     v8::Local<v8::String> pattern
   , v8::RegExp::Flags flags) {
-  return Factory<v8::RegExp>::return_t(v8::RegExp::New(pattern, flags));
+  return v8::RegExp::New(pattern, flags);
 }
 
 //=== Script 
===================================================================
 
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source) {
-  return Factory<v8::Script>::return_t(v8::Script::New(source));
+  return v8::Script::New(source);
 }
 Factory<v8::Script>::return_t
 Factory<v8::Script>::New( v8::Local<v8::String> source
                         , v8::ScriptOrigin const& origin) {
-  return Factory<v8::Script>::return_t(
-      v8::Script::New(source, const_cast<v8::ScriptOrigin*>(&origin)));
+  return v8::Script::New(source, const_cast<v8::ScriptOrigin*>(&origin));
 }
 
 //=== Signature 
================================================================
@@ -199,35 +199,34 @@
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New() {
-  return Factory<v8::String>::return_t(v8::String::Empty());
+  return v8::String::Empty();
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(const char * value, int length) {
-  return Factory<v8::String>::return_t(v8::String::New(value, length));
+  return v8::String::New(value, length);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(
     std::string const& value) /* NOLINT(build/include_what_you_use) */ {
   assert(value.size() <= INT_MAX && "string too long");
-  return Factory<v8::String>::return_t(
-      v8::String::New( value.data(), static_cast<int>(value.size())));
+  return v8::String::New(value.data(), static_cast<int>(value.size()));
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(const uint16_t * value, int length) {
-  return Factory<v8::String>::return_t(v8::String::New(value, length));
+  return v8::String::New(value, length);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
-  return Factory<v8::String>::return_t(v8::String::NewExternal(value));
+  return v8::String::NewExternal(value);
 }
 
 Factory<v8::String>::return_t
 Factory<v8::String>::New(v8::String::ExternalAsciiStringResource * value) {
-  return Factory<v8::String>::return_t(v8::String::NewExternal(value));
+  return v8::String::NewExternal(value);
 }
 
 //=== String Object 
============================================================
diff --git a/node_modules/nan/nan_maybe_43_inl.h 
b/node_modules/nan/nan_maybe_43_inl.h
index a8b432d..10eeb02 100644
--- a/node_modules/nan/nan_maybe_43_inl.h
+++ b/node_modules/nan/nan_maybe_43_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -25,26 +25,35 @@
   return v8::Just<T>(t);
 }
 
-v8::Local<v8::Context> GetCurrentContext();
-
 inline
 MaybeLocal<v8::String> ToDetailString(v8::Local<v8::Value> val) {
-  return val->ToDetailString(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(val->ToDetailString(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
 }
 
 inline
 MaybeLocal<v8::Uint32> ToArrayIndex(v8::Local<v8::Value> val) {
-  return val->ToArrayIndex(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Uint32>()));
 }
 
 inline
 Maybe<bool> Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b)) {
-  return a->Equals(GetCurrentContext(), b);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return a->Equals(isolate->GetCurrentContext(), b);
 }
 
 inline
 MaybeLocal<v8::Object> NewInstance(v8::Local<v8::Function> h) {
-  return h->NewInstance(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Object>()));
 }
 
 inline
@@ -52,32 +61,45 @@
       v8::Local<v8::Function> h
     , int argc
     , v8::Local<v8::Value> argv[]) {
-  return h->NewInstance(GetCurrentContext(), argc, argv);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv)
+                          .FromMaybe(v8::Local<v8::Object>()));
 }
 
 inline
 MaybeLocal<v8::Object> NewInstance(v8::Local<v8::ObjectTemplate> h) {
-  return h->NewInstance(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Object>()));
 }
 
 
 inline MaybeLocal<v8::Function> GetFunction(
     v8::Local<v8::FunctionTemplate> t) {
-  return t->GetFunction(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(t->GetFunction(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Function>()));
 }
 
 inline Maybe<bool> Set(
     v8::Local<v8::Object> obj
   , v8::Local<v8::Value> key
   , v8::Local<v8::Value> value) {
-  return obj->Set(GetCurrentContext(), key, value);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Set(isolate->GetCurrentContext(), key, value);
 }
 
 inline Maybe<bool> Set(
     v8::Local<v8::Object> obj
   , uint32_t index
   , v8::Local<v8::Value> value) {
-  return obj->Set(GetCurrentContext(), index, value);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Set(isolate->GetCurrentContext(), index, value);
 }
 
 inline Maybe<bool> ForceSet(
@@ -85,102 +107,148 @@
   , v8::Local<v8::Value> key
   , v8::Local<v8::Value> value
   , v8::PropertyAttribute attribs = v8::None) {
-  return obj->ForceSet(GetCurrentContext(), key, value, attribs);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
 }
 
 inline MaybeLocal<v8::Value> Get(
     v8::Local<v8::Object> obj
   , v8::Local<v8::Value> key) {
-  return obj->Get(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->Get(isolate->GetCurrentContext(), key)
+                          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline
 MaybeLocal<v8::Value> Get(v8::Local<v8::Object> obj, uint32_t index) {
-  return obj->Get(GetCurrentContext(), index);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->Get(isolate->GetCurrentContext(), index)
+                          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline v8::PropertyAttribute GetPropertyAttributes(
     v8::Local<v8::Object> obj
   , v8::Local<v8::Value> key) {
-  return obj->GetPropertyAttributes(GetCurrentContext(), key).FromJust();
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key)
+      .FromJust();
 }
 
 inline Maybe<bool> Has(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->Has(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Has(isolate->GetCurrentContext(), key);
 }
 
 inline Maybe<bool> Has(v8::Local<v8::Object> obj, uint32_t index) {
-  return obj->Has(GetCurrentContext(), index);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Has(isolate->GetCurrentContext(), index);
 }
 
 inline Maybe<bool> Delete(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->Delete(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Delete(isolate->GetCurrentContext(), key);
 }
 
 inline
 Maybe<bool> Delete(v8::Local<v8::Object> obj, uint32_t index) {
-  return obj->Delete(GetCurrentContext(), index);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Delete(isolate->GetCurrentContext(), index);
 }
 
 inline
 MaybeLocal<v8::Array> GetPropertyNames(v8::Local<v8::Object> obj) {
-  return obj->GetPropertyNames(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Array>()));
 }
 
 inline
 MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Local<v8::Object> obj) {
-  return obj->GetOwnPropertyNames(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Array>()));
 }
 
 inline Maybe<bool> SetPrototype(
     v8::Local<v8::Object> obj
   , v8::Local<v8::Value> prototype) {
-  return obj->SetPrototype(GetCurrentContext(), prototype);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->SetPrototype(isolate->GetCurrentContext(), prototype);
 }
 
 inline MaybeLocal<v8::String> ObjectProtoToString(
     v8::Local<v8::Object> obj) {
-  return obj->ObjectProtoToString(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
 }
 
 inline Maybe<bool> HasOwnProperty(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->HasOwnProperty(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasOwnProperty(isolate->GetCurrentContext(), key);
 }
 
 inline Maybe<bool> HasRealNamedProperty(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->HasRealNamedProperty(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key);
 }
 
 inline Maybe<bool> HasRealIndexedProperty(
     v8::Local<v8::Object> obj
   , uint32_t index) {
-  return obj->HasRealIndexedProperty(GetCurrentContext(), index);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index);
 }
 
 inline Maybe<bool> HasRealNamedCallbackProperty(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->HasRealNamedCallbackProperty(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key);
 }
 
 inline MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->GetRealNamedPropertyInPrototypeChain(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain(
+                             isolate->GetCurrentContext(), key)
+                          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline MaybeLocal<v8::Value> GetRealNamedProperty(
     v8::Local<v8::Object> obj
   , v8::Local<v8::String> key) {
-  return obj->GetRealNamedProperty(GetCurrentContext(), key);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->GetRealNamedProperty(isolate->GetCurrentContext(), key)
+          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline MaybeLocal<v8::Value> CallAsFunction(
@@ -188,49 +256,70 @@
   , v8::Local<v8::Object> recv
   , int argc
   , v8::Local<v8::Value> argv[]) {
-  return obj->CallAsFunction(GetCurrentContext(), recv, argc, argv);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline MaybeLocal<v8::Value> CallAsConstructor(
     v8::Local<v8::Object> obj
   , int argc, v8::Local<v8::Value> argv[]) {
-  return obj->CallAsConstructor(GetCurrentContext(), argc, argv);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 inline
 MaybeLocal<v8::String> GetSourceLine(v8::Local<v8::Message> msg) {
-  return msg->GetSourceLine(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
 }
 
 inline Maybe<int> GetLineNumber(v8::Local<v8::Message> msg) {
-  return msg->GetLineNumber(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetLineNumber(isolate->GetCurrentContext());
 }
 
 inline Maybe<int> GetStartColumn(v8::Local<v8::Message> msg) {
-  return msg->GetStartColumn(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetStartColumn(isolate->GetCurrentContext());
 }
 
 inline Maybe<int> GetEndColumn(v8::Local<v8::Message> msg) {
-  return msg->GetEndColumn(GetCurrentContext());
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetEndColumn(isolate->GetCurrentContext());
 }
 
 inline MaybeLocal<v8::Object> CloneElementAt(
     v8::Local<v8::Array> array
   , uint32_t index) {
 #if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION)
-  v8::EscapableHandleScope handle_scope(v8::Isolate::GetCurrent());
-  v8::Local<v8::Context> context = GetCurrentContext();
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
   v8::Local<v8::Value> elem;
-  if (!array->Get(context, index).ToLocal(&elem)) {
-    return MaybeLocal<v8::Object>();
-  }
   v8::Local<v8::Object> obj;
-  if (!elem->ToObject(context).ToLocal(&obj)) {
-    return MaybeLocal<v8::Object>();
+  if (!array->Get(context, index).ToLocal(&elem)) {
+    return scope.Escape(obj);
   }
-  return MaybeLocal<v8::Object>(handle_scope.Escape(obj->Clone()));
+  if (!elem->ToObject(context).ToLocal(&obj)) {
+    return scope.Escape(v8::Local<v8::Object>());
+  }
+  return scope.Escape(obj->Clone());
 #else
-  return array->CloneElementAt(GetCurrentContext(), index);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), 
index)
+                          .FromMaybe(v8::Local<v8::Object>()));
 #endif
 }
 
@@ -239,7 +328,10 @@
   , v8::Local<v8::Object> recv
   , int argc
   , v8::Local<v8::Value> argv[]) {
-  return fun->Call(GetCurrentContext(), recv, argc, argv);
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv)
+                          .FromMaybe(v8::Local<v8::Value>()));
 }
 
 #endif  // NAN_MAYBE_43_INL_H_
diff --git a/node_modules/nan/nan_maybe_pre_43_inl.h 
b/node_modules/nan/nan_maybe_pre_43_inl.h
index 625c422..d47181e 100644
--- a/node_modules/nan/nan_maybe_pre_43_inl.h
+++ b/node_modules/nan/nan_maybe_pre_43_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_new.h b/node_modules/nan/nan_new.h
index 6c7d19f..628f40c 100644
--- a/node_modules/nan/nan_new.h
+++ b/node_modules/nan/nan_new.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_object_wrap.h 
b/node_modules/nan/nan_object_wrap.h
index f1cc156..28281b0 100644
--- a/node_modules/nan/nan_object_wrap.h
+++ b/node_modules/nan/nan_object_wrap.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_persistent_12_inl.h 
b/node_modules/nan/nan_persistent_12_inl.h
index ddb585f..a23d899 100644
--- a/node_modules/nan/nan_persistent_12_inl.h
+++ b/node_modules/nan/nan_persistent_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_persistent_pre_12_inl.h 
b/node_modules/nan/nan_persistent_pre_12_inl.h
index 32267ec..f915746 100644
--- a/node_modules/nan/nan_persistent_pre_12_inl.h
+++ b/node_modules/nan/nan_persistent_pre_12_inl.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/nan_private.h b/node_modules/nan/nan_private.h
index 11912c4..03082cd 100644
--- a/node_modules/nan/nan_private.h
+++ b/node_modules/nan/nan_private.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -24,16 +24,20 @@
 
 inline MaybeLocal<v8::Value>
 GetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key) {
-  HandleScope scope;
 #if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
   v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
   v8::Local<v8::Context> context = isolate->GetCurrentContext();
   v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
-  return object->GetPrivate(context, private_key);
+  v8::MaybeLocal<v8::Value> v = object->GetPrivate(context, private_key);
+  return scope.Escape(v.ToLocalChecked());
 #else
+  EscapableHandleScope scope;
   v8::Local<v8::Value> v = object->GetHiddenValue(key);
-  v8::Local<v8::Value> def = Undefined();
-  return MaybeLocal<v8::Value>(v.IsEmpty() ? def : v);
+  if (v.IsEmpty()) {
+    v = Undefined();
+  }
+  return scope.Escape(v);
 #endif
 }
 
@@ -56,6 +60,7 @@
     v8::Local<v8::Object> object,
     v8::Local<v8::String> key) {
 #if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
+  HandleScope scope;
   v8::Isolate *isolate = v8::Isolate::GetCurrent();
   v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
   return object->DeletePrivate(isolate->GetCurrentContext(), private_key);
diff --git a/node_modules/nan/nan_typedarray_contents.h 
b/node_modules/nan/nan_typedarray_contents.h
index 62720ba..17c9681 100644
--- a/node_modules/nan/nan_typedarray_contents.h
+++ b/node_modules/nan/nan_typedarray_contents.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
@@ -14,6 +14,7 @@
  public:
   inline explicit TypedArrayContents(v8::Local<v8::Value> from) :
       length_(0), data_(NULL) {
+    HandleScope scope;
 
     size_t length = 0;
     void*  data = NULL;
diff --git a/node_modules/nan/nan_weak.h b/node_modules/nan/nan_weak.h
index 93f6fe8..3f2d569 100644
--- a/node_modules/nan/nan_weak.h
+++ b/node_modules/nan/nan_weak.h
@@ -1,7 +1,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/nan/package.json b/node_modules/nan/package.json
index 6eacbda..89eb776 100644
--- a/node_modules/nan/package.json
+++ b/node_modules/nan/package.json
@@ -14,19 +14,19 @@
     ]
   ],
   "_from": "nan@>=2.3.3 <3.0.0",
-  "_id": "nan@2.5.0",
+  "_id": "nan@2.5.1",
   "_inCache": true,
   "_location": "/nan",
-  "_nodeVersion": "6.3.1",
+  "_nodeVersion": "7.4.0",
   "_npmOperationalInternal": {
-    "host": "packages-12-west.internal.npmjs.com",
-    "tmp": "tmp/nan-2.5.0.tgz_1482346189010_0.8120697599370033"
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/nan-2.5.1.tgz_1485124061146_0.7941144248470664"
   },
   "_npmUser": {
     "name": "kkoopa",
     "email": "bbyh...@abo.fi"
   },
-  "_npmVersion": "3.10.3",
+  "_npmVersion": "4.0.5",
   "_phantomChildren": {},
   "_requested": {
     "raw": "nan@^2.3.3",
@@ -40,8 +40,8 @@
   "_requiredBy": [
     "/dtrace-provider"
   ],
-  "_resolved": "https://registry.npmjs.org/nan/-/nan-2.5.0.tgz";,
-  "_shasum": "aa8f1e34531d807e9e27755b234b4a6ec0c152a8",
+  "_resolved": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz";,
+  "_shasum": "d5b01691253326a97a2bbee9e61c55d8d60351e2",
   "_shrinkwrap": null,
   "_spec": "nan@^2.3.3",
   "_where": "/opt/service/node_modules/dtrace-provider",
@@ -98,8 +98,8 @@
   },
   "directories": {},
   "dist": {
-    "shasum": "aa8f1e34531d807e9e27755b234b4a6ec0c152a8",
-    "tarball": "https://registry.npmjs.org/nan/-/nan-2.5.0.tgz";
+    "shasum": "d5b01691253326a97a2bbee9e61c55d8d60351e2",
+    "tarball": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz";
   },
   "homepage": "https://github.com/nodejs/nan#readme";,
   "license": "MIT",
@@ -126,5 +126,5 @@
     "rebuild-tests": "node-gyp rebuild --msvs_version=2013 --directory test",
     "test": "tap --gc --stderr test/js/*-test.js"
   },
-  "version": "2.5.0"
+  "version": "2.5.1"
 }
diff --git a/node_modules/nan/tools/1to2.js b/node_modules/nan/tools/1to2.js
index b7498e4..1e86be7 100755
--- a/node_modules/nan/tools/1to2.js
+++ b/node_modules/nan/tools/1to2.js
@@ -2,7 +2,7 @@
 /*********************************************************************
  * NAN - Native Abstractions for Node.js
  *
- * Copyright (c) 2016 NAN contributors
+ * Copyright (c) 2017 NAN contributors
  *
  * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
  ********************************************************************/
diff --git a/node_modules/normalize-package-data/test/normalize.js~ 
b/node_modules/normalize-package-data/test/normalize.js~
new file mode 100644
index 0000000..de6f1ce
--- /dev/null
+++ b/node_modules/normalize-package-data/test/normalize.js~
@@ -0,0 +1,253 @@
+var tap = require("tap")
+var fs = require("fs")
+var path = require("path")
+
+var globals = Object.keys(global)
+
+var normalize = require("../lib/normalize")
+var warningMessages = require("../lib/warning_messages.json")
+var safeFormat = require("../lib/safe_format")
+
+var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json")
+
+tap.test("normalize some package data", function(t) {
+  var packageData = require(rpjPath)
+  var warnings = []
+  normalize(packageData, function(warning) {
+    warnings.push(warning)
+  })
+  // there's no readme data in this particular object
+  t.equal( warnings.length, 1, "There's exactly one warning.")
+  fs.readFile(rpjPath, function(err, data) {
+    if(err) throw err
+    // Various changes have been made
+    t.notEqual(packageData, JSON.parse(data), "Output is different from 
input.")
+    t.end()
+  })
+})
+
+tap.test("runs without passing warning function", function(t) {
+  var packageData = require(rpjPath)
+  fs.readFile(rpjPath, function(err, data) {
+    if(err) throw err
+    normalize(JSON.parse(data))
+    t.ok(true, "If you read this, this means I'm still alive.")
+    t.end()
+  })
+})
+
+tap.test("empty object", function(t) {
+  var packageData = {}
+  var expect =
+    { name: '',
+      version: '',
+      readme: 'ERROR: No README data found!',
+      _id: '@' }
+
+  var warnings = []
+  function warn(m) {
+    warnings.push(m)
+  }
+  normalize(packageData, warn)
+  t.same(packageData, expect)
+  t.same(warnings, [
+    warningMessages.missingDescription,
+    warningMessages.missingRepository,
+    warningMessages.missingReadme,
+    warningMessages.missingLicense
+  ])
+  t.end()
+})
+
+tap.test("core module name", function(t) {
+  var warnings = []
+  function warn(m) {
+    warnings.push(m)
+  }
+  var a
+  normalize(a={
+    name: "http",
+    readme: "read yourself how about",
+    homepage: 123,
+    bugs: "what is this i don't even",
+    repository: "Hello."
+  }, warn)
+
+  var expect = [
+      safeFormat(warningMessages.conflictingName, 'http'),
+      warningMessages.nonEmailUrlBugsString,
+      warningMessages.emptyNormalizedBugs,
+      warningMessages.nonUrlHomepage,
+      warningMessages.missingLicense
+      ]
+  t.same(warnings, expect)
+  t.end()
+})
+
+tap.test("urls required", function(t) {
+  var warnings = []
+  function warn(w) {
+    warnings.push(w)
+  }
+  normalize({
+    bugs: {
+      url: "/1",
+      email: "not an email address"
+    }
+  }, warn)
+  var a
+  normalize(a={
+    readme: "read yourself how about",
+    homepage: 123,
+    bugs: "what is this i don't even",
+    repository: "Hello."
+  }, warn)
+
+  console.error(a)
+
+  var expect =
+    [ warningMessages.missingDescription,
+      warningMessages.missingRepository,
+      warningMessages.nonUrlBugsUrlField,
+      warningMessages.nonEmailBugsEmailField,
+      warningMessages.emptyNormalizedBugs,
+      warningMessages.missingReadme,
+      warningMessages.missingLicense,
+      warningMessages.nonEmailUrlBugsString,
+      warningMessages.emptyNormalizedBugs,
+      warningMessages.nonUrlHomepage,
+      warningMessages.missingLicense]
+  t.same(warnings, expect)
+  t.end()
+})
+
+tap.test("homepage field must start with a protocol.", function(t) {
+  var warnings = []
+  function warn(w) {
+    warnings.push(w)
+  }
+  var a
+  normalize(a={
+    homepage: 'example.org'
+  }, warn)
+
+  console.error(a)
+
+  var expect =
+    [ warningMessages.missingDescription,
+      warningMessages.missingRepository,
+      warningMessages.missingReadme,
+      warningMessages.missingProtocolHomepage,
+      warningMessages.missingLicense]
+  t.same(warnings, expect)
+  t.same(a.homepage, 'http://example.org')
+  t.end()
+})
+
+tap.test("license field should be a valid SPDX expression", function(t) {
+  var warnings = []
+  function warn(w) {
+    warnings.push(w)
+  }
+  var a
+  normalize(a={
+    license: 'Apache 2'
+  }, warn)
+
+  console.error(a)
+
+  var expect =
+    [ warningMessages.missingDescription,
+      warningMessages.missingRepository,
+      warningMessages.missingReadme,
+      warningMessages.invalidLicense]
+  t.same(warnings, expect)
+  t.end()
+})
+
+tap.test("gist bugs url", function(t) {
+  var d = {
+    repository: "g...@gist.github.com:123456.git"
+  }
+  normalize(d)
+  t.same(d.repository, { type: 'git', url: 
'git+ssh://g...@gist.github.com/123456.git' })
+  t.same(d.bugs, { url: 'https://gist.github.com/123456' })
+  t.end();
+});
+
+tap.test("singularize repositories", function(t) {
+  var d = {repositories:["g...@gist.github.com:123456.git"]}
+  normalize(d)
+  t.same(d.repository, { type: 'git', url: 
'git+ssh://g...@gist.github.com/123456.git' })
+  t.end()
+});
+
+tap.test("treat visionmedia/express as github repo", function(t) {
+  var d = {repository: {type: "git", url: "visionmedia/express"}}
+  normalize(d)
+  t.same(d.repository, { type: "git", url: 
"git+https://github.com/visionmedia/express.git"; })
+  t.end()
+});
+
+tap.test("treat isaacs/node-graceful-fs as github repo", function(t) {
+  var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}}
+  normalize(d)
+  t.same(d.repository, { type: "git", url: 
"git+https://github.com/isaacs/node-graceful-fs.git"; })
+  t.end()
+});
+
+tap.test("homepage field will set to github url if repository is a github 
repo", function(t) {
+  var a
+  normalize(a={
+    repository: { type: "git", url: 
"https://github.com/isaacs/node-graceful-fs"; }
+  })
+  t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme')
+  t.end()
+})
+
+tap.test("homepage field will set to github gist url if repository is a gist", 
function(t) {
+  var a
+  normalize(a={
+    repository: { type: "git", url: "g...@gist.github.com:123456.git" }
+  })
+  t.same(a.homepage, 'https://gist.github.com/123456')
+  t.end()
+})
+
+tap.test("homepage field will set to github gist url if repository is a 
shorthand reference", function(t) {
+  var a
+  normalize(a={
+    repository: { type: "git", url: "sindresorhus/chalk" }
+  })
+  t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme')
+  t.end()
+})
+
+tap.test("don't mangle github shortcuts in dependencies", function(t) {
+  var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}}
+  normalize(d)
+  t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" 
})
+  t.end()
+});
+
+tap.test("deprecation warning for array in dependencies fields", function(t) {
+  var a
+  var warnings = []
+  function warn(w) {
+    warnings.push(w)
+  }
+  normalize(a={
+    dependencies: [],
+    devDependencies: [],
+    optionalDependencies: []
+  }, warn)
+  
t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 
'dependencies')), "deprecation warning")
+  
t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 
'devDependencies')), "deprecation warning")
+  
t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 
'optionalDependencies')), "deprecation warning")
+  t.end()
+})
+
+tap.test('no new globals', function(t) {
+  t.same(Object.keys(global), globals)
+  t.end()
+})
diff --git a/node_modules/swagger-ui/package.json 
b/node_modules/swagger-ui/package.json
index aa08ce2..d29aa8e 100644
--- a/node_modules/swagger-ui/package.json
+++ b/node_modules/swagger-ui/package.json
@@ -49,7 +49,7 @@
     "/hyperswitch"
   ],
   "_resolved": 
"git+https://github.com/wikimedia/swagger-ui.git#b9b40dc8e00caeb24c19fe636b93250a7e335541";,
-  "_shasum": "6e90ba65442fb5b7028040ef61a4fd7a4cb085e1",
+  "_shasum": "bc40621eeaff75042e1bbd22caa9a80a3f44acbb",
   "_shrinkwrap": null,
   "_spec": "swagger-ui@git+https://github.com/wikimedia/swagger-ui.git#master";,
   "_where": "/opt/service/node_modules/hyperswitch",
diff --git a/restbase b/restbase
index baefa3b..5d1d44f 160000
--- a/restbase
+++ b/restbase
@@ -1 +1 @@
-Subproject commit baefa3b0bcb0df508292f2135df6afae109e9009
+Subproject commit 5d1d44fabf7c129c9a2cffb6b1cf638f09619ec8

-- 
To view, visit https://gerrit.wikimedia.org/r/333795
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8ce373b06b80a60997674ba940f7bf357542c9f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to