diff --git a/src/utils.cc b/src/utils.cc index dc5d5278..2bf2917a 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -240,7 +240,7 @@ namespace OZW { } bool isOzwValue(Local& o) { - return (!Nan::HasOwnProperty(o, Nan::New("nodeid").ToLocalChecked()).IsNothing() + return (!Nan::HasOwnProperty(o, Nan::New("node_id").ToLocalChecked()).IsNothing() && !Nan::HasOwnProperty(o, Nan::New("class_id").ToLocalChecked()).IsNothing() && !Nan::HasOwnProperty(o, Nan::New("instance").ToLocalChecked()).IsNothing() && !Nan::HasOwnProperty(o, Nan::New("index").ToLocalChecked()).IsNothing()); @@ -261,20 +261,15 @@ namespace OZW { if ( (info.Length() >= offset) && info[offset]->IsObject() ) { Local o = info[offset]->ToObject(); if (isOzwValue(o)) { - nodeid = Nan::Get(o, Nan::New("nodeid").ToLocalChecked()).ToLocalChecked()->ToNumber()->Value(); + nodeid = Nan::Get(o, Nan::New("node_id").ToLocalChecked()).ToLocalChecked()->ToNumber()->Value(); comclass = Nan::Get(o, Nan::New("class_id").ToLocalChecked()).ToLocalChecked()->ToNumber()->Value(); instance = Nan::Get(o, Nan::New("instance").ToLocalChecked()).ToLocalChecked()->ToNumber()->Value(); index = Nan::Get(o, Nan::New("index").ToLocalChecked()).ToLocalChecked()->ToNumber()->Value(); } else { return ( NULL ); } - } else if ( - (info.Length() >= offset+4) - && info[offset]->IsNumber() - && info[offset+1]->IsNumber() - && info[offset+2]->IsNumber() - && info[offset+3]->IsNumber() - ) { // legacy mode + } else if ((info.Length() >= offset+4)) { + // legacy mode nodeid = info[offset]->ToNumber()->Value(); comclass = info[offset+1]->ToNumber()->Value(); instance = info[offset+2]->ToNumber()->Value();