MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / SafeCall

Function SafeCall

src/util/helpers.cpp:47–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// node-addon-api bug, present as of v8.9.0, triggered by Node-API version 10).
46
47inline Napi::Value SafeCall(Napi::Env env, Napi::Function fn, napi_value recv, size_t argc, const napi_value* args) {
48 napi_value result;
49 if (napi_call_function(env, recv, fn, argc, args, &result) != napi_ok) return Napi::Value();
50 return Napi::Value(env, result);
51}
52
53inline Napi::Object SafeConstruct(Napi::Env env, Napi::Function constructor) {
54 napi_value result;

Callers 12

LogMethod · 0.85
NewRecordMethod · 0.85
NODE_METHODFunction · 0.85
GetRowJSMethod · 0.85
GetRawRowJSMethod · 0.85
xConnectMethod · 0.85
xFilterMethod · 0.85
xNextMethod · 0.85
xStepBaseMethod · 0.85
xValueBaseMethod · 0.85
GetAccumulatorMethod · 0.85
xFuncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected