Skip to content

n-api: duplicated parameters on napi_open_callback_scope #32897

Closed

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.

Activity

  1. added
    async_hooksIssues and PRs related to the async hooks subsystem.
    node-apiIssues and PRs related to Node-API.
    on Apr 17, 2020
  2. self-assigned this
    on Apr 17, 2020
  3. gabrielschulhof commented on Nov 13, 2020

    @gabrielschulhof
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions