napi_get_prototype


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

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

  • [in] objectnapi_value 表示要返回其原型的 JavaScript Object。这将返回 Object.getPrototypeOf 的等价物(与函数的 prototype 属性不同)。

    ¥[in] object: napi_value representing JavaScript Object whose prototype to return. This returns the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property).

  • [out] resultnapi_value 表示给定对象的原型。

    ¥[out] result: napi_value representing prototype of the given object.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.