napi_check_object_type_tag


napi_status napi_check_object_type_tag(napi_env env,
                                       napi_value js_object,
                                       const napi_type_tag* type_tag,
                                       bool* result); 
  • [in] env:调用 API 的环境。

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

  • [in] js_object:要检查其类型标记的 JavaScript 对象。

    ¥[in] js_object: The JavaScript object whose type tag to examine.

  • [in] type_tag:用于比较在对象上找到的任何标签的标签。

    ¥[in] type_tag: The tag with which to compare any tag found on the object.

  • [out] result:给定的类型标签是否与对象上的类型标签匹配。如果在对象上未找到类型标记,也会返回 false

    ¥[out] result: Whether the type tag given matched the type tag on the object. false is also returned if no type tag was found on the object.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

将作为 type_tag 给出的指针与 js_object 上可以找到的任何指针进行比较。如果在 js_object 上没有找到标签,或者如果找到标签但它与 type_tag 不匹配,则 result 设置为 false。如果找到标签并且它与 type_tag 匹配,则将 result 设置为 true

¥Compares the pointer given as type_tag with any that can be found on js_object. If no tag is found on js_object or, if a tag is found but it does not match type_tag, then result is set to false. If a tag is found and it matches type_tag, then result is set to true.