Skip to content

Commit acbb2da

Browse files
JeetuSuthartargos
authored andcommitted
node-api: make napi_delete_reference use node_api_basic_env
PR-URL: #59684 Refs: #59583 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Vladimir Morozov <[email protected]>
1 parent 634a889 commit acbb2da

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/js_native_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ napi_create_reference(napi_env env,
352352

353353
// Deletes a reference. The referenced value is released, and may
354354
// be GC'd unless there are other references to it.
355-
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(napi_env env,
355+
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(node_api_basic_env env,
356356
napi_ref ref);
357357

358358
// Increments the reference count, optionally returning the resulting count.

src/js_native_api_v8.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,8 @@ napi_status NAPI_CDECL napi_create_reference(napi_env env,
27732773
// there are other references to it.
27742774
// For a napi_reference returned from `napi_wrap`, this must be called in the
27752775
// finalizer.
2776-
napi_status NAPI_CDECL napi_delete_reference(napi_env env, napi_ref ref) {
2776+
napi_status NAPI_CDECL napi_delete_reference(node_api_basic_env env,
2777+
napi_ref ref) {
27772778
// Omit NAPI_PREAMBLE and GET_RETURN_STATUS because V8 calls here cannot throw
27782779
// JS exceptions.
27792780
CHECK_ENV(env);

0 commit comments

Comments
 (0)