@@ -38,7 +38,7 @@ namespace OZW {
3838 // =================================================================
3939 {
4040 Nan::HandleScope scope;
41- bool doSecurity = info.Length () > 0 && info[0 ]-> ToBoolean ()->Value ();
41+ bool doSecurity = info.Length () > 0 && Nan::To<Boolean>( info[0 ]). ToLocalChecked ()->Value ();
4242 info.GetReturnValue ().Set (Nan::New<Boolean>(
4343 OpenZWave::Manager::Get ()->AddNode (homeid, doSecurity)
4444 ));
@@ -74,7 +74,7 @@ namespace OZW {
7474 {
7575 Nan::HandleScope scope;
7676 CheckMinArgs (1 , " nodeid" );
77- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
77+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
7878 info.GetReturnValue ().Set (Nan::New<Boolean>(
7979 OpenZWave::Manager::Get ()->RemoveFailedNode (homeid, nodeid)
8080 ));
@@ -93,7 +93,7 @@ namespace OZW {
9393 {
9494 Nan::HandleScope scope;
9595 CheckMinArgs (1 , " nodeid" );
96- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
96+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
9797 info.GetReturnValue ().Set (Nan::New<Boolean>(
9898 OpenZWave::Manager::Get ()->HasNodeFailed (homeid, nodeid)
9999 ));
@@ -109,7 +109,7 @@ namespace OZW {
109109 {
110110 Nan::HandleScope scope;
111111 CheckMinArgs (1 , " nodeid" );
112- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
112+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
113113 info.GetReturnValue ().Set (Nan::New<Boolean>(
114114 OpenZWave::Manager::Get ()->RequestNodeNeighborUpdate (homeid, nodeid)
115115 ));
@@ -125,7 +125,7 @@ namespace OZW {
125125 {
126126 Nan::HandleScope scope;
127127 CheckMinArgs (1 , " nodeid" );
128- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
128+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
129129 info.GetReturnValue ().Set (Nan::New<Boolean>(
130130 OpenZWave::Manager::Get ()->AssignReturnRoute (homeid, nodeid)
131131 ));
@@ -142,7 +142,7 @@ namespace OZW {
142142 {
143143 Nan::HandleScope scope;
144144 CheckMinArgs (1 , " nodeid" );
145- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
145+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
146146 info.GetReturnValue ().Set (Nan::New<Boolean>(
147147 OpenZWave::Manager::Get ()->DeleteAllReturnRoutes (homeid, nodeid)
148148 ));
@@ -158,7 +158,7 @@ namespace OZW {
158158 {
159159 Nan::HandleScope scope;
160160 CheckMinArgs (1 , " nodeid" );
161- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
161+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
162162 info.GetReturnValue ().Set (Nan::New<Boolean>(
163163 OpenZWave::Manager::Get ()->SendNodeInformation (homeid, nodeid)
164164 ));
@@ -206,7 +206,7 @@ namespace OZW {
206206 {
207207 Nan::HandleScope scope;
208208 CheckMinArgs (1 , " nodeid" );
209- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
209+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
210210 info.GetReturnValue ().Set (Nan::New<Boolean>(
211211 OpenZWave::Manager::Get ()->ReplaceFailedNode (homeid, nodeid)
212212 ));
@@ -235,7 +235,7 @@ namespace OZW {
235235 {
236236 Nan::HandleScope scope;
237237 CheckMinArgs (1 , " nodeid" );
238- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
238+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
239239 info.GetReturnValue ().Set (Nan::New<Boolean>(
240240 OpenZWave::Manager::Get ()->RequestNetworkUpdate (homeid, nodeid)
241241 ));
@@ -250,7 +250,7 @@ namespace OZW {
250250 {
251251 Nan::HandleScope scope;
252252 CheckMinArgs (1 , " nodeid" );
253- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
253+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
254254 info.GetReturnValue ().Set (Nan::New<Boolean>(
255255 OpenZWave::Manager::Get ()->ReplicationSend (homeid, nodeid)
256256 ));
@@ -265,8 +265,8 @@ namespace OZW {
265265 {
266266 Nan::HandleScope scope;
267267 CheckMinArgs (2 , " nodeid, buttonid" );
268- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
269- uint8 btnid = info[1 ]-> ToNumber ()->Value ();
268+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
269+ uint8 btnid = Nan::To<Number>( info[1 ]). ToLocalChecked ()->Value ();
270270 info.GetReturnValue ().Set (Nan::New<Boolean>(
271271 OpenZWave::Manager::Get ()->CreateButton (homeid, nodeid, btnid)
272272 ));
@@ -281,8 +281,8 @@ namespace OZW {
281281 {
282282 Nan::HandleScope scope;
283283 CheckMinArgs (2 , " nodeid, buttonid" );
284- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
285- uint8 btnid = info[1 ]-> ToNumber ()->Value ();
284+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
285+ uint8 btnid = Nan::To<Number>( info[1 ]). ToLocalChecked ()->Value ();
286286 info.GetReturnValue ().Set (Nan::New<Boolean>(
287287 OpenZWave::Manager::Get ()->DeleteButton (homeid, nodeid, btnid)
288288 ));
@@ -299,16 +299,16 @@ namespace OZW {
299299 {
300300 Nan::HandleScope scope;
301301 CheckMinArgs (1 , " command" );
302- std::string ctrcmd = (*String::Utf8Value (info[0 ]-> ToString ()));
302+ std::string ctrcmd = (*String::Utf8Value (Nan::To<String>( info[0 ]). ToLocalChecked ()-> Value ()));
303303 uint8 nodeid1 = 0xff ;
304304 uint8 nodeid2 = 0 ;
305305 bool highpower = false ;
306306 if (info.Length () > 1 ) {
307- highpower = info[1 ]-> ToBoolean ()->Value ();
307+ highpower = Nan::To<Boolean>( info[1 ]). ToLocalChecked ()->Value ();
308308 if (info.Length () > 2 ) {
309- nodeid1 = info[2 ]-> ToNumber ()->Value ();
309+ nodeid1 = Nan::To<Number>( info[2 ]). ToLocalChecked ()->Value ();
310310 if (info.Length () > 3 ) {
311- nodeid2 = info[3 ]-> ToNumber ()->Value ();
311+ nodeid2 = Nan::To<Number>( info[3 ]). ToLocalChecked ()->Value ();
312312 }
313313 }
314314 }
@@ -400,7 +400,7 @@ namespace OZW {
400400 Nan::HandleScope scope;
401401 CheckMinArgs (1 , " nodeid" );
402402 OpenZWave::Node::NodeData data;
403- uint8 nodeid = info[0 ]-> ToNumber ()->Value ();
403+ uint8 nodeid = Nan::To<Number>( info[0 ]). ToLocalChecked ()->Value ();
404404
405405 OpenZWave::Manager::Get ()->GetNodeStatistics (homeid, nodeid, &data);
406406
0 commit comments