node/test/node-api/test_async_context
Anna Henningsen 0ec1d186f4 src: always use strong reference to napi_async_context resource
There already is an existing requirement to have matching calls of
`napi_async_init()` and `napi_async_destroy()`, so expecting users
of this API to manually hold onto the resource for the duration of
the `napi_async_context`'s lifetime is unnecessary.

Weak callbacks are generally useful for when a corresponding C++
object should be cleaned up when a JS object is gargbage-collected,
but that is not the case here.

PR-URL: https://github.com/nodejs/node/pull/59828
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-09-22 14:16:10 +00:00
..
binding.c test: rename n-api to node-api 2021-02-06 05:03:38 -08:00
binding.gyp
test-gcable-callback.js src: always use strong reference to napi_async_context resource 2025-09-22 14:16:10 +00:00
test.js test: add trailing commas in test/node-api 2023-01-29 20:01:09 +01:00