Skip to content

napi: why napi can be called in async execute function? #1998

Closed
@heroboy

Description

@heroboy

https://github.com/nodejs/node/blob/938e11882b96e19b443477571455088baaa054d8/test/node-api/test_async/test_async.cc#L24

See this function ,it calls napi_throw_type_error.
In the document:https://nodejs.org/docs/latest/api/n-api.html#n_api_napi_create_async_work, executor is called in another thread, so it can't call any napi function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions