- Version: n-api v6
- Platform: all
- Subsystem: n-api
napi_open_callback_scope accepts an napi_value resource_object and another napi_async_context context, while an napi_async_context has to be created with an napi_value async_resource and its associated napi_value async_resource_name. In this case, napi_open_callback_scope can infer resource_object to the given napi_async_context.
Unfortunately, napi_async_context currently doesn't hold a reference to its async_resource. So napi_open_callback_scope is unable to access the resource_object too.
This also creates a potential conflict that which resource object should represent the executionAsyncResource of the napi_callback_scope.
napi_open_callback_scopeaccepts annapi_value resource_objectand anothernapi_async_context context, while annapi_async_contexthas to be created with annapi_value async_resourceand its associatednapi_value async_resource_name. In this case,napi_open_callback_scopecan inferresource_objectto the givennapi_async_context.Unfortunately,
napi_async_contextcurrently doesn't hold a reference to itsasync_resource. Sonapi_open_callback_scopeis unable to access theresource_objecttoo.This also creates a potential conflict that which resource object should represent the executionAsyncResource of the
napi_callback_scope.