Skip to content

Commit aa79e37

Browse files
authored
Merge pull request #587 from timrach/patch-1
Fix example code in doc/class_property_descriptor
2 parents df75e08 + b3609d3 commit aa79e37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

doc/class_property_descriptor.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Example : public Napi::ObjectWrap<Example> {
2020
static Napi::FunctionReference constructor;
2121
double _value;
2222
Napi::Value GetValue(const Napi::CallbackInfo &info);
23-
Napi::Value SetValue(const Napi::CallbackInfo &info);
23+
void SetValue(const Napi::CallbackInfo &info, const Napi::Value &value);
2424
};
2525

2626
Napi::Object Example::Init(Napi::Env env, Napi::Object exports) {
@@ -52,12 +52,11 @@ Napi::Value Example::GetValue(const Napi::CallbackInfo &info) {
5252
return Napi::Number::New(env, this->_value);
5353
}
5454

55-
Napi::Value Example::SetValue(const Napi::CallbackInfo &info, const Napi::Value &value) {
55+
void Example::SetValue(const Napi::CallbackInfo &info, const Napi::Value &value) {
5656
Napi::Env env = info.Env();
5757
// ...
5858
Napi::Number arg = value.As<Napi::Number>();
5959
this->_value = arg.DoubleValue();
60-
return this->GetValue(info);
6160
}
6261

6362
// Initialize native add-on

0 commit comments

Comments
 (0)