node-api: make napi_delete_reference use node_api_basic_env

PR-URL: https://github.com/nodejs/node/pull/59684
Refs: https://github.com/nodejs/node/issues/59583
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
This commit is contained in:
Jeetu Suthar authored and GitHub committed 2025-09-12 15:58:57 +00:00
1 parent 8869210dd8
commit af4eac574b
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -364,7 +364,7 @@ napi_create_reference(napi_env env,
// Deletes a reference. The referenced value is released, and may
// be GC'd unless there are other references to it.
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(napi_env env,
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(node_api_basic_env env,
napi_ref ref);
// Increments the reference count, optionally returning the resulting count.
+2 -1
View File
@@ -2773,7 +2773,8 @@ napi_status NAPI_CDECL napi_create_reference(napi_env env,
// there are other references to it.
// For a napi_reference returned from `napi_wrap`, this must be called in the
// finalizer.
napi_status NAPI_CDECL napi_delete_reference(napi_env env, napi_ref ref) {
napi_status NAPI_CDECL napi_delete_reference(node_api_basic_env env,
napi_ref ref) {
// Omit NAPI_PREAMBLE and GET_RETURN_STATUS because V8 calls here cannot throw
// JS exceptions.
CHECK_ENV(env);