| 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; |
nothing calls this directly
no test coverage detected