| 138 | } |
| 139 | |
| 140 | Value CreateFunctionReferenceUsingNew(const Napi::CallbackInfo& info) { |
| 141 | Napi::Function func = ObjectWrap<FuncRefObject>::DefineClass( |
| 142 | info.Env(), |
| 143 | "MyObject", |
| 144 | {ObjectWrap<FuncRefObject>::InstanceMethod("getValue", |
| 145 | &FuncRefObject::GetValue)}); |
| 146 | Napi::FunctionReference* constructor = new Napi::FunctionReference(); |
| 147 | *constructor = Napi::Persistent(func); |
| 148 | |
| 149 | return MaybeUnwrapOr(constructor->New({info[0].As<Number>()}), Object()); |
| 150 | } |
| 151 | |
| 152 | Value CreateFunctionReferenceUsingNewVec(const Napi::CallbackInfo& info) { |
| 153 | Napi::Function func = ObjectWrap<FuncRefObject>::DefineClass( |
nothing calls this directly
no test coverage detected