| 150 | } |
| 151 | |
| 152 | Value CreateFunctionReferenceUsingNewVec(const Napi::CallbackInfo& info) { |
| 153 | Napi::Function func = ObjectWrap<FuncRefObject>::DefineClass( |
| 154 | info.Env(), |
| 155 | "MyObject", |
| 156 | {ObjectWrap<FuncRefObject>::InstanceMethod("getValue", |
| 157 | &FuncRefObject::GetValue)}); |
| 158 | Napi::FunctionReference* constructor = new Napi::FunctionReference(); |
| 159 | *constructor = Napi::Persistent(func); |
| 160 | std::vector<napi_value> newVec; |
| 161 | newVec.push_back(info[0]); |
| 162 | |
| 163 | return MaybeUnwrapOr(constructor->New(newVec), Object()); |
| 164 | } |
| 165 | |
| 166 | Value Call(const CallbackInfo& info) { |
| 167 | EscapableHandleScope scope(info.Env()); |
nothing calls this directly
no test coverage detected