GeezerVison is showing github.com — Patch LockMasterSetStatus · nodegit/nodegit@7f4fd05
File tree
Expand file treeCollapse file tree
Open diff view settings
generate/templates/templates
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: generate/templates/templates/nodegit.cc +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -69,9 +69,10 @@ void LockMasterSetStatus(const FunctionCallbackInfo<Value>& info) { |
69 | 69 | Nan::HandleScope scope; |
70 | 70 |
|
71 | 71 | // convert the first argument to Status |
72 | | - if(info.Length() >= 0 && info[0]->IsNumber()) { |
73 | | - v8::Local<v8::Int32> value = info[0]->ToInt32(); |
74 | | - LockMaster::Status status = static_cast<LockMaster::Status>(value->Value()); |
| 72 | + if(info.Length() >= 0 && info[0]->IsUint32()) { |
| 73 | + uint value = info[0]->Uint32Value(); |
| 74 | + |
| 75 | + LockMaster::Status status = static_cast<LockMaster::Status>(value); |
75 | 76 | if(status >= LockMaster::Disabled && status <= LockMaster::Enabled) { |
76 | 77 | LockMaster::SetStatus(status); |
77 | 78 | return; |
@@ -82,6 +83,7 @@ void LockMasterSetStatus(const FunctionCallbackInfo<Value>& info) { |
82 | 83 | Nan::ThrowError("Argument must be one 0, 1 or 2"); |
83 | 84 | } |
84 | 85 |
|
| 86 | + |
85 | 87 | void LockMasterGetStatus(const FunctionCallbackInfo<Value>& info) { |
86 | 88 | info.GetReturnValue().Set(Nan::New(LockMaster::GetStatus())); |
87 | 89 | } |
|