Skip to content

Resource is optional in napi_async_init #33153

Closed
@legendecas

Description

@legendecas

Maybe we should also think about adapting napi_async_init as it states that the resource is optional. As Node is meanwhile built to require an async resource it seems to be strange that we create an object on the fly if user doesn't provide one.
Removing the null check in napi_async_init would be no issue from ABI point of view but breaking from behavior. Not sure if this should be included in this PR.

Originally posted by @Flarna in #32930

Metadata

Metadata

Assignees

No one assigned

    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