Skip to content

n-api: duplicated parameters on napi_open_callback_scope #32897

@legendecas

Description

@legendecas
  • 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.

Metadata

Metadata

Assignees

Labels

async_hooksIssues and PRs related to the async hooks subsystem.node-apiIssues and PRs related to the Node-API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions