Replace Handle with Local depending on Node.js version

Use newly introduced macros like SWIGV8_VALUE to use v8::Handle or
v8::Local depending on the selected Node.js version where possible.
This commit is contained in:
Yegor Yefremov 2020-02-26 15:55:18 +01:00
commit 26fc996ad6
10 changed files with 82 additions and 76 deletions

View file

@ -68,16 +68,16 @@ SWIG_V8_GetModule(void *) {
// TODO: is it ok to do that?
extern "C"
#if (NODE_MODULE_VERSION < 0x000C)
void SWIGV8_INIT (v8::Handle<v8::Object> exports)
void SWIGV8_INIT (SWIGV8_OBJECT exports)
#else
void SWIGV8_INIT (v8::Handle<v8::Object> exports, v8::Handle<v8::Object> /*module*/)
void SWIGV8_INIT (SWIGV8_OBJECT exports, SWIGV8_OBJECT /*module*/)
#endif
{
SWIG_InitializeModule(static_cast<void *>(&exports));
SWIGV8_HANDLESCOPE();
v8::Handle<v8::Object> exports_obj = exports;
SWIGV8_OBJECT exports_obj = exports;
%}