MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / CheckCast

Method CheckCast

napi-inl.h:1638–1648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636}
1637
1638inline void Object::CheckCast(napi_env env, napi_value value) {
1639 NAPI_CHECK(value != nullptr, "Object::CheckCast", "empty value");
1640
1641 napi_valuetype type;
1642 napi_status status = napi_typeof(env, value, &type);
1643 NAPI_CHECK(status == napi_ok, "Object::CheckCast", "napi_typeof failed");
1644 NAPI_INTERNAL_CHECK(type == napi_object || type == napi_function,
1645 "Object::CheckCast",
1646 "Expect napi_object or napi_function, but got %d.",
1647 type);
1648}
1649
1650inline Object::Object() : TypeTaggable() {}
1651

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected