napi_get_reference_value


NAPI_EXTERN napi_status napi_get_reference_value(napi_env env,
                                                 napi_ref ref,
                                                 napi_value* result); 

传入或传出这些方法的 napi_value 是与该引用相关的对象的句柄。

🌐 the napi_value passed in or out of these methods is a handle to the object to which the reference is related.

  • [in] env:API 被调用时所处的环境。
  • [in] ref:我们正在请求对应的 Objectnapi_ref
  • [out] resultnapi_ref引用的Objectnapi_value

如果 API 成功,则返回 napi_ok

🌐 Returns napi_ok if the API succeeded.

如果仍然有效,该 API 会返回表示与 napi_ref 关联的 JavaScript Objectnapi_value。否则,结果将是 NULL

🌐 If still valid, this API returns the napi_value representing the JavaScript Object associated with the napi_ref. Otherwise, result will be NULL.