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] object:napi_value表示要返回其原型的 JavaScriptObject。这将返回Object.getPrototypeOf的等价物(与函数的prototype属性不同)。¥
[in] object:napi_valuerepresenting JavaScriptObjectwhose prototype to return. This returns the equivalent ofObject.getPrototypeOf(which is not the same as the function'sprototypeproperty). -
[out] result:napi_value表示给定对象的原型。¥
[out] result:napi_valuerepresenting prototype of the given object.
如果 API 成功,则返回 napi_ok。
¥Returns napi_ok if the API succeeded.