| 40 | } |
| 41 | |
| 42 | Value CallWithVectorArgs(const CallbackInfo& info) { |
| 43 | EscapableHandleScope scope(info.Env()); |
| 44 | std::vector<napi_value> newVec; |
| 45 | FunctionReference ref; |
| 46 | ref.Reset(info[0].As<Function>()); |
| 47 | |
| 48 | for (int i = 1; i < (int)info.Length(); i++) { |
| 49 | newVec.push_back(info[i]); |
| 50 | } |
| 51 | return scope.Escape(MaybeUnwrap(ref.Call(newVec))); |
| 52 | } |
| 53 | |
| 54 | Value CallWithInitList(const CallbackInfo& info) { |
| 55 | EscapableHandleScope scope(info.Env()); |