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

Function IsInstanceOf

src/util/helpers.cpp:116–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114// native class. Each native class is identified by a unique type tag, which
115// gets applied to each of its instances upon construction.
116template <typename T> inline bool IsInstanceOf(Napi::Env env, Napi::Value value) {
117 bool result = false;
118 napi_status status = napi_check_object_type_tag(env, value.As<Napi::Object>(), &T::TYPE_TAG, &result);
119 return status == napi_ok && result;
120}
121
122// Wraps a native method so that it can only be invoked on a receiver that is
123// backed by the expected native class. Node-API has no equivalent of

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected