@@ -88,7 +88,7 @@ v8::Local<v8::Value> getValueFromObject(v8::Local<v8::Object> options, std::stri
8888
8989int getIntFromObject (v8::Local<v8::Object> options, std::string key) {
9090 #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 ();
9292 #else
9393 return getValueFromObject (options, key)->ToInt32 ()->Int32Value ();
9494 #endif
@@ -104,7 +104,7 @@ v8::Local<v8::String> getStringFromObj(v8::Local<v8::Object> options, std::strin
104104
105105double getDoubleFromObject (v8::Local<v8::Object> options, std::string key) {
106106 #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 );
108108 #else
109109 return getValueFromObject (options, key)->ToNumber ()->NumberValue ();
110110 #endif
@@ -181,7 +181,7 @@ void EIO_AfterOpen(uv_work_t* req) {
181181
182182 int fd;
183183 #if NODE_MAJOR_VERSION >= 10
184- fd = argv[1 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
184+ fd = argv[1 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
185185 #else
186186 fd = argv[1 ]->ToInt32 ()->Int32Value ();
187187 #endif
@@ -205,7 +205,7 @@ NAN_METHOD(Update) {
205205 }
206206 int fd;
207207 #if NODE_MAJOR_VERSION >= 10
208- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
208+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
209209 #else
210210 fd = info[0 ]->ToInt32 ()->Int32Value ();
211211 #endif
@@ -233,7 +233,7 @@ NAN_METHOD(Update) {
233233
234234 baton->fd = fd;
235235 #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 ();
237237 #else
238238 baton->baudRate = Nan::Get (options, Nan::New<v8::String>(" baudRate" ).ToLocalChecked ()).ToLocalChecked ()->ToInt32 ()->Int32Value ();
239239 #endif
@@ -273,7 +273,7 @@ NAN_METHOD(Write) {
273273 }
274274 int fd;
275275 #if NODE_MAJOR_VERSION >= 10
276- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
276+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
277277 #else
278278 fd = info[0 ]->ToInt32 ()->Int32Value ();
279279 #endif
@@ -394,7 +394,7 @@ NAN_METHOD(Close) {
394394 CloseBaton* baton = new CloseBaton ();
395395 memset (baton, 0 , sizeof (CloseBaton));
396396 #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 ();
398398 #else
399399 baton->fd = info[0 ]->ToInt32 ()->Int32Value ();
400400 #endif
@@ -511,7 +511,7 @@ NAN_METHOD(Flush) {
511511 }
512512 int fd;
513513 #if NODE_MAJOR_VERSION >= 10
514- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
514+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
515515 #else
516516 fd = info[0 ]->ToInt32 ()->Int32Value ();
517517 #endif
@@ -564,7 +564,7 @@ NAN_METHOD(Set) {
564564 }
565565 int fd;
566566 #if NODE_MAJOR_VERSION >= 10
567- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
567+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
568568 #else
569569 fd = info[0 ]->ToInt32 ()->Int32Value ();
570570 #endif
@@ -626,7 +626,7 @@ NAN_METHOD(Drain) {
626626 }
627627 int fd;
628628 #if NODE_MAJOR_VERSION >= 10
629- fd = info[0 ]->ToInt32 (v8::Isolate::GetCurrent ())-> Int32Value ();
629+ fd = info[0 ]->ToInt32 (Nan::GetCurrentContext ()). ToLocalChecked ()-> Value ();
630630 #else
631631 fd = info[0 ]->ToInt32 ()->Int32Value ();
632632 #endif
@@ -697,7 +697,7 @@ SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
697697}
698698
699699extern " C" {
700- void init_serialport (v8::Handle <v8::Object> target) {
700+ void init_serialport ( v8::Local <v8::Object> target) {
701701 Nan::HandleScope scope;
702702 Nan::SetMethod (target, " set" , Set);
703703 Nan::SetMethod (target, " open" , Open);
0 commit comments