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

Function SetInstanceGetter

src/util/helpers.cpp:167–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165// displayed by console.log(), albeit as [Getter]).
166template <typename T, Napi::Value (*method)(const Napi::CallbackInfo&)>
167void SetInstanceGetter(Napi::Object obj, const char* name, Addon* addon) {
168 napi_property_descriptor desc = {};
169 desc.utf8name = name;
170 desc.getter = TypeSafeCallback<T, method>;
171 desc.attributes = napi_enumerable;
172 desc.data = addon;
173 napi_status status = napi_define_properties(obj.Env(), obj, 1, &desc);
174 assert(status == napi_ok || status == napi_cannot_run_js); ((void)status);
175}
176
177// Determines whether to skip the given character at the start of an SQL string.
178inline bool IS_SKIPPED(char c) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected