Skip to content

n-api: duplicated parameters on napi_open_callback_scope #32897

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
legendecas opened this issue Apr 17, 2020 · 1 comment
Closed

n-api: duplicated parameters on napi_open_callback_scope #32897

legendecas opened this issue Apr 17, 2020 · 1 comment
Assignees
Labels
async_hooks Issues and PRs related to the async hooks subsystem. node-api Issues and PRs related to the Node-API.

Comments

@legendecas
Copy link
Member

legendecas commented Apr 17, 2020

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

@legendecas legendecas added async_hooks Issues and PRs related to the async hooks subsystem. node-api Issues and PRs related to the Node-API. labels Apr 17, 2020
@legendecas legendecas self-assigned this Apr 17, 2020
@gabrielschulhof
Copy link
Contributor

This issue is addressed in #32930 via a documentation change, which has proven the only way to address without ABI breakage.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

No branches or pull requests

2 participants