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

Function HasOwnPropertyWithCStyleString

test/object/has_own_property.cc:21–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21Value HasOwnPropertyWithCStyleString(const CallbackInfo& info) {
22 Object obj = info[0].UnsafeAs<Object>();
23 String jsKey = info[1].As<String>();
24 return Boolean::New(
25 info.Env(),
26 MaybeUnwrapOr(obj.HasOwnProperty(jsKey.Utf8Value().c_str()), false));
27}
28
29Value HasOwnPropertyWithCppStyleString(const CallbackInfo& info) {
30 Object obj = info[0].UnsafeAs<Object>();

Callers

nothing calls this directly

Calls 3

MaybeUnwrapOrFunction · 0.85
EnvMethod · 0.80
HasOwnPropertyMethod · 0.80

Tested by

no test coverage detected