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

Method xValueBase

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

Source from the content-addressed store, hash-verified

55 }
56
57 static inline void xValueBase(sqlite3_context* invocation, bool is_final) {
58 AGGREGATE_START();
59
60 if (!is_final) {
61 acc->is_window = true;
62 } else if (acc->is_window) {
63 DestroyAccumulator(invocation);
64 return;
65 }
66
67 Napi::Value result = acc->value.Value();
68 if (self->invoke_result) {
69 napi_value arg = result;
70 Napi::Value maybeResult = SafeCall(env, self->result.Value(), env.Undefined(), 1, &arg);
71 if (env.IsExceptionPending()) {
72 self->PropagateJSError(invocation);
73 return;
74 }
75 result = maybeResult;
76 }
77
78 Data::ResultValueFromJS(env, invocation, result, self);
79 if (is_final) DestroyAccumulator(invocation);
80 }
81
82 struct Accumulator { public:
83 Napi::Reference<Napi::Value> value;

Callers

nothing calls this directly

Calls 3

PropagateJSErrorMethod · 0.95
SafeCallFunction · 0.85
ResultValueFromJSFunction · 0.85

Tested by

no test coverage detected