This repository was archived by the owner on Oct 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
vendor/node-usb-native/src Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,11 @@ NAN_METHOD(SerialportPoller::New) {
8383 }
8484
8585 SerialportPoller* obj = new SerialportPoller ();
86- obj->fd_ = info[0 ]->ToInt32 ()->Int32Value ();
86+ #if NODE_MAJOR_VERSION >= 10
87+ obj->fd_ = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())->Int32Value ();
88+ #else
89+ obj->fd_ = info[0 ]->ToInt32 ()->Int32Value ();
90+ #endif
8791 obj->callback_ = new Nan::Callback (info[1 ].As <v8::Function>());
8892 // obj->callCallback();
8993
Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ OpenBatonPlatformOptions* ParsePlatformOptions(const v8::Local<v8::Object>& opti
4141 Nan::HandleScope scope;
4242
4343 UnixPlatformOptions* result = new UnixPlatformOptions ();
44- result->vmin = Nan::Get (options, Nan::New<v8::String>(" vmin" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
45- result->vtime = Nan::Get (options, Nan::New<v8::String>(" vtime" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
44+ #if NODE_MAJOR_VERSION >= 10
45+ result->vmin = Nan::Get (options, Nan::New<v8::String>(" vmin" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 (v8::Isolate::GetCurrent ())->Int32Value ();
46+ result->vtime = Nan::Get (options, Nan::New<v8::String>(" vtime" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 (v8::Isolate::GetCurrent ())->Int32Value ();
47+ #else
48+ result->vmin = Nan::Get (options, Nan::New<v8::String>(" vmin" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
49+ result->vtime = Nan::Get (options, Nan::New<v8::String>(" vtime" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
50+ #endif
4651
4752 return result;
4853}
You can’t perform that action at this time.
0 commit comments