This repository was archived by the owner on Oct 1, 2024. It is now read-only.
File tree 2 files changed +12
-3
lines changed
vendor/node-usb-native/src
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) {
83
83
}
84
84
85
85
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
87
91
obj->callback_ = new Nan::Callback (info[1 ].As <v8::Function>());
88
92
// obj->callCallback();
89
93
Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ OpenBatonPlatformOptions* ParsePlatformOptions(const v8::Local<v8::Object>& opti
41
41
Nan::HandleScope scope;
42
42
43
43
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
46
51
47
52
return result;
48
53
}
You can’t perform that action at this time.
0 commit comments