napi_get_reference_value


NAPI_EXTERN napi_status napi_get_reference_value(napi_env env,
                                                 napi_ref ref,
                                                 napi_value* result); 
  • [in] env:调用 API 的环境。

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

  • [in] ref:请求相应值的 napi_ref

    ¥[in] ref: The napi_ref for which the corresponding value is being requested.

  • [out] resultnapi_ref 引用的 napi_value

    ¥[out] result: The napi_value referenced by the napi_ref.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

如果仍然有效,此 API 将返回 napi_value,表示与 napi_ref 关联的 JavaScript 值。否则,结果将为 NULL

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