napi_instanceof


napi_status napi_instanceof(napi_env env,
                            napi_value object,
                            napi_value constructor,
                            bool* result) 
  • [in] env:调用 API 的环境。

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

  • [in] object:要检查的 JavaScript 值。

    ¥[in] object: The JavaScript value to check.

  • [in] constructor:要检查的构造函数的 JavaScript 函数对象。

    ¥[in] constructor: The JavaScript function object of the constructor function to check against.

  • [out] result:如果 object instanceof constructor 为 true,则设置为 true 的布尔值。

    ¥[out] result: Boolean that is set to true if object instanceof constructor is true.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

此 API 代表在 ECMAScript 语言规范的 第 12.10.4 节 中定义的对象上调用 instanceof 运算符。

¥This API represents invoking the instanceof Operator on the object as defined in Section 12.10.4 of the ECMAScript Language Specification.