diff --git a/generate/templates/templates/nodegit.cc b/generate/templates/templates/nodegit.cc index e81bbb85f4..b7cf3c060e 100644 --- a/generate/templates/templates/nodegit.cc +++ b/generate/templates/templates/nodegit.cc @@ -69,9 +69,10 @@ void LockMasterSetStatus(const FunctionCallbackInfo& info) { Nan::HandleScope scope; // convert the first argument to Status - if(info.Length() >= 0 && info[0]->IsNumber()) { - v8::Local value = info[0]->ToInt32(); - LockMaster::Status status = static_cast(value->Value()); + if(info.Length() >= 0 && info[0]->IsUint32()) { + uint value = info[0]->Uint32Value(); + + LockMaster::Status status = static_cast(value); if(status >= LockMaster::Disabled && status <= LockMaster::Enabled) { LockMaster::SetStatus(status); return; @@ -82,6 +83,7 @@ void LockMasterSetStatus(const FunctionCallbackInfo& info) { Nan::ThrowError("Argument must be one 0, 1 or 2"); } + void LockMasterGetStatus(const FunctionCallbackInfo& info) { info.GetReturnValue().Set(Nan::New(LockMaster::GetStatus())); }