@@ -88,7 +88,7 @@ v8::Local<v8::Value> getValueFromObject(v8::Local<v8::Object> options, std::stri
88
88
89
89
int getIntFromObject (v8::Local<v8::Object> options, std::string key) {
90
90
#if NODE_MAJOR_VERSION >= 10
91
- return getValueFromObject (options, key)-> ToInt32 ( v8::Isolate::GetCurrent ())-> Int32Value ();
91
+ return Nan::To<v8::Int32>( getValueFromObject (options, key)). ToLocalChecked ()-> Value ();
92
92
#else
93
93
return getValueFromObject (options, key)->ToInt32 ()->Int32Value ();
94
94
#endif
@@ -104,7 +104,7 @@ v8::Local<v8::String> getStringFromObj(v8::Local<v8::Object> options, std::strin
104
104
105
105
double getDoubleFromObject (v8::Local<v8::Object> options, std::string key) {
106
106
#if NODE_MAJOR_VERSION >= 10
107
- return getValueFromObject (options, key)-> ToNumber ( v8::Isolate::GetCurrent ())-> NumberValue ( );
107
+ return Nan::To< double >( getValueFromObject (options, key)). FromMaybe ( 0 );
108
108
#else
109
109
return getValueFromObject (options, key)->ToNumber ()->NumberValue ();
110
110
#endif
@@ -181,7 +181,7 @@ void EIO_AfterOpen(uv_work_t* req) {
181
181
182
182
int fd;
183
183
#if NODE_MAJOR_VERSION >= 10
184
- fd = argv[1 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
184
+ fd = argv[1 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
185
185
#else
186
186
fd = argv[1 ]->ToInt32 ()->Int32Value ();
187
187
#endif
@@ -205,7 +205,7 @@ NAN_METHOD(Update) {
205
205
}
206
206
int fd;
207
207
#if NODE_MAJOR_VERSION >= 10
208
- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
208
+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
209
209
#else
210
210
fd = info[0 ]->ToInt32 ()->Int32Value ();
211
211
#endif
@@ -233,7 +233,7 @@ NAN_METHOD(Update) {
233
233
234
234
baton->fd = fd;
235
235
#if NODE_MAJOR_VERSION >= 10
236
- baton->baudRate = Nan::Get (options, Nan::New<v8::String>(" baudRate" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
236
+ baton->baudRate = Nan::Get (options, Nan::New<v8::String>(" baudRate" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
237
237
#else
238
238
baton->baudRate = Nan::Get (options, Nan::New<v8::String>(" baudRate" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
239
239
#endif
@@ -273,7 +273,7 @@ NAN_METHOD(Write) {
273
273
}
274
274
int fd;
275
275
#if NODE_MAJOR_VERSION >= 10
276
- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
276
+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
277
277
#else
278
278
fd = info[0 ]->ToInt32 ()->Int32Value ();
279
279
#endif
@@ -394,7 +394,7 @@ NAN_METHOD(Close) {
394
394
CloseBaton* baton = new CloseBaton ();
395
395
memset (baton, 0 , sizeof (CloseBaton));
396
396
#if NODE_MAJOR_VERSION >= 10
397
- baton->fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
397
+ baton->fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
398
398
#else
399
399
baton->fd = info[0 ]->ToInt32 ()->Int32Value ();
400
400
#endif
@@ -511,7 +511,7 @@ NAN_METHOD(Flush) {
511
511
}
512
512
int fd;
513
513
#if NODE_MAJOR_VERSION >= 10
514
- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
514
+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
515
515
#else
516
516
fd = info[0 ]->ToInt32 ()->Int32Value ();
517
517
#endif
@@ -564,7 +564,7 @@ NAN_METHOD(Set) {
564
564
}
565
565
int fd;
566
566
#if NODE_MAJOR_VERSION >= 10
567
- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
567
+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
568
568
#else
569
569
fd = info[0 ]->ToInt32 ()->Int32Value ();
570
570
#endif
@@ -626,7 +626,7 @@ NAN_METHOD(Drain) {
626
626
}
627
627
int fd;
628
628
#if NODE_MAJOR_VERSION >= 10
629
- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
629
+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
630
630
#else
631
631
fd = info[0 ]->ToInt32 ()->Int32Value ();
632
632
#endif
@@ -697,7 +697,7 @@ SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
697
697
}
698
698
699
699
extern " C" {
700
- void init_serialport (v8::Handle <v8::Object> target) {
700
+ void init_serialport ( v8::Local <v8::Object> target) {
701
701
Nan::HandleScope scope;
702
702
Nan::SetMethod (target, " set" , Set);
703
703
Nan::SetMethod (target, " open" , Open);
0 commit comments