diff --git a/vendor/node-usb-native/src/combined.cpp b/vendor/node-usb-native/src/combined.cpp index a7f4cc0f..965a482d 100644 --- a/vendor/node-usb-native/src/combined.cpp +++ b/vendor/node-usb-native/src/combined.cpp @@ -9,11 +9,11 @@ #include extern "C" { - void init_serialport(v8::Handle target); + void init_serialport( v8::Local target); #ifndef DISABLE_USB_DETECTOR - void init_detector(v8::Handle target); + void init_detector( v8::Local target); #endif - void initAll(v8::Handle target) { + void initAll( v8::Local target) { init_serialport(target); #ifndef DISABLE_USB_DETECTOR init_detector(target); diff --git a/vendor/node-usb-native/src/detection.cpp b/vendor/node-usb-native/src/detection.cpp index 5a16729f..b5b76215 100644 --- a/vendor/node-usb-native/src/detection.cpp +++ b/vendor/node-usb-native/src/detection.cpp @@ -210,7 +210,7 @@ void StopMonitoring(const Nan::FunctionCallbackInfo& args) { } extern "C" { - void init_detector (v8::Handle target) { + void init_detector ( v8::Local target) { Nan::SetMethod(target, "find", Find); Nan::SetMethod(target, "registerAdded", RegisterAdded); Nan::SetMethod(target, "registerRemoved", RegisterRemoved); diff --git a/vendor/node-usb-native/src/serialport.cpp b/vendor/node-usb-native/src/serialport.cpp index 755037b3..3ea15f83 100644 --- a/vendor/node-usb-native/src/serialport.cpp +++ b/vendor/node-usb-native/src/serialport.cpp @@ -88,7 +88,7 @@ v8::Local getValueFromObject(v8::Local options, std::stri int getIntFromObject(v8::Local options, std::string key) { #if NODE_MAJOR_VERSION >= 10 - return getValueFromObject(options, key)->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + return Nan::To(getValueFromObject(options, key)).ToLocalChecked()->Value(); #else return getValueFromObject(options, key)->ToInt32()->Int32Value(); #endif @@ -104,7 +104,7 @@ v8::Local getStringFromObj(v8::Local options, std::strin double getDoubleFromObject(v8::Local options, std::string key) { #if NODE_MAJOR_VERSION >= 10 - return getValueFromObject(options, key)->ToNumber(v8::Isolate::GetCurrent())->NumberValue(); + return Nan::To(getValueFromObject(options, key)).FromMaybe(0); #else return getValueFromObject(options, key)->ToNumber()->NumberValue(); #endif @@ -181,7 +181,7 @@ void EIO_AfterOpen(uv_work_t* req) { int fd; #if NODE_MAJOR_VERSION >= 10 - fd = argv[1]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = argv[1]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = argv[1]->ToInt32()->Int32Value(); #endif @@ -205,7 +205,7 @@ NAN_METHOD(Update) { } int fd; #if NODE_MAJOR_VERSION >= 10 - fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = info[0]->ToInt32()->Int32Value(); #endif @@ -233,7 +233,7 @@ NAN_METHOD(Update) { baton->fd = fd; #if NODE_MAJOR_VERSION >= 10 - baton->baudRate = Nan::Get(options, Nan::New("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + baton->baudRate = Nan::Get(options, Nan::New("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else baton->baudRate = Nan::Get(options, Nan::New("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value(); #endif @@ -273,7 +273,7 @@ NAN_METHOD(Write) { } int fd; #if NODE_MAJOR_VERSION >= 10 - fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = info[0]->ToInt32()->Int32Value(); #endif @@ -394,7 +394,7 @@ NAN_METHOD(Close) { CloseBaton* baton = new CloseBaton(); memset(baton, 0, sizeof(CloseBaton)); #if NODE_MAJOR_VERSION >= 10 - baton->fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + baton->fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else baton->fd = info[0]->ToInt32()->Int32Value(); #endif @@ -511,7 +511,7 @@ NAN_METHOD(Flush) { } int fd; #if NODE_MAJOR_VERSION >= 10 - fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = info[0]->ToInt32()->Int32Value(); #endif @@ -564,7 +564,7 @@ NAN_METHOD(Set) { } int fd; #if NODE_MAJOR_VERSION >= 10 - fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = info[0]->ToInt32()->Int32Value(); #endif @@ -626,7 +626,7 @@ NAN_METHOD(Drain) { } int fd; #if NODE_MAJOR_VERSION >= 10 - fd = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + fd = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else fd = info[0]->ToInt32()->Int32Value(); #endif @@ -697,7 +697,7 @@ SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) { } extern "C" { - void init_serialport(v8::Handle target) { + void init_serialport( v8::Local target) { Nan::HandleScope scope; Nan::SetMethod(target, "set", Set); Nan::SetMethod(target, "open", Open); diff --git a/vendor/node-usb-native/src/serialport_poller.cpp b/vendor/node-usb-native/src/serialport_poller.cpp index 7471f2a3..d4b5b229 100644 --- a/vendor/node-usb-native/src/serialport_poller.cpp +++ b/vendor/node-usb-native/src/serialport_poller.cpp @@ -49,7 +49,7 @@ void SerialportPoller::callCallback(int status) { -void SerialportPoller::Init(Handle target) { +void SerialportPoller::Init(Local target) { Nan::HandleScope scope; // Prepare constructor template @@ -84,7 +84,7 @@ NAN_METHOD(SerialportPoller::New) { SerialportPoller* obj = new SerialportPoller(); #if NODE_MAJOR_VERSION >= 10 - obj->fd_ = info[0]->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + obj->fd_ = info[0]->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else obj->fd_ = info[0]->ToInt32()->Int32Value(); #endif diff --git a/vendor/node-usb-native/src/serialport_poller.h b/vendor/node-usb-native/src/serialport_poller.h index 4d20b07d..2e35de06 100644 --- a/vendor/node-usb-native/src/serialport_poller.h +++ b/vendor/node-usb-native/src/serialport_poller.h @@ -10,7 +10,7 @@ class SerialportPoller : public Nan::ObjectWrap { public: - static void Init(v8::Handle target); + static void Init( v8::Local target); void callCallback(int status); diff --git a/vendor/node-usb-native/src/serialport_unix.cpp b/vendor/node-usb-native/src/serialport_unix.cpp index cd27b40c..e225683d 100644 --- a/vendor/node-usb-native/src/serialport_unix.cpp +++ b/vendor/node-usb-native/src/serialport_unix.cpp @@ -42,8 +42,8 @@ OpenBatonPlatformOptions* ParsePlatformOptions(const v8::Local& opti UnixPlatformOptions* result = new UnixPlatformOptions(); #if NODE_MAJOR_VERSION >= 10 - result->vmin = Nan::Get(options, Nan::New("vmin").ToLocalChecked()).ToLocalChecked()->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); - result->vtime = Nan::Get(options, Nan::New("vtime").ToLocalChecked()).ToLocalChecked()->ToInt32(v8::Isolate::GetCurrent())->Int32Value(); + result->vmin = Nan::Get(options, Nan::New("vmin").ToLocalChecked()).ToLocalChecked()->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); + result->vtime = Nan::Get(options, Nan::New("vtime").ToLocalChecked()).ToLocalChecked()->ToInt32(Nan::GetCurrentContext()).ToLocalChecked()->Value(); #else result->vmin = Nan::Get(options, Nan::New("vmin").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value(); result->vtime = Nan::Get(options, Nan::New("vtime").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();