napi_instanceof

Function napi_instanceof 

Source
pub unsafe extern "C" fn napi_instanceof(
    env: napi_env,
    object: napi_value,
    constructor: napi_value,
    result: *mut bool,
) -> napi_status
Available on crate feature napi only.
Expand description

Invoke instanceof operation on the object.

§Arguments

  • env - Current running virtual machine context.

  • object - The ArkTS object to check.

  • constructor - The ArkTS constructor function to check against.

  • result - Set to true if the given ArkTS object instanceof constructor.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, object, constructor and(or) result is nullptr.

[napi_object_expected] If the param object is not an ArkTS object value.

[napi_function_expected] If the param constructor is not an ArkTS function value.

[napi_pending_exception] If have uncaught exception, or exception occurred in execution.

Available since API-level: 10