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

Method xStepBase

src/util/custom-aggregate.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37private:
38
39 static inline void xStepBase(sqlite3_context* invocation, int argc, sqlite3_value** argv, const Napi::FunctionReference CustomAggregate::*ptrtm) {
40 AGGREGATE_START();
41
42 napi_value args_fast[5];
43 napi_value* args = argc <= 4 ? args_fast : ALLOC_ARRAY<napi_value>(argc + 1);
44 args[0] = acc->value.Value();
45 if (argc != 0) Data::GetArgumentsJS(env, args + 1, argv, argc, self->safe_ints);
46
47 Napi::Value returnValue = SafeCall(env, (self->*ptrtm).Value(), env.Undefined(), argc + 1, args);
48 if (args != args_fast) delete[] args;
49
50 if (env.IsExceptionPending()) {
51 self->PropagateJSError(invocation);
52 } else {
53 if (!returnValue.IsUndefined()) acc->value.Reset(returnValue, 1);
54 }
55 }
56
57 static inline void xValueBase(sqlite3_context* invocation, bool is_final) {
58 AGGREGATE_START();

Callers

nothing calls this directly

Calls 3

PropagateJSErrorMethod · 0.95
GetArgumentsJSFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected