napi_has_named_property


napi_status napi_has_named_property(napi_env env,
                                    napi_value object,
                                    const char* utf8Name,
                                    bool* result); 
  • [in] env:调用 Node-API 调用的环境。

    ¥[in] env: The environment that the Node-API call is invoked under.

  • [in] object:要查询的对象。

    ¥[in] object: The object to query.

  • [in] utf8Name:要检查其存在的属性的名称。

    ¥[in] utf8Name: The name of the property whose existence to check.

  • [out] result:该属性是否存在于对象上。

    ¥[out] result: Whether the property exists on the object or not.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

此方法等效于使用从作为 utf8Name 传入的字符串创建的 napi_value 调用 napi_has_property

¥This method is equivalent to calling napi_has_property with a napi_value created from the string passed in as utf8Name.