MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / OnAsyncWorkExecute

Method OnAsyncWorkExecute

napi-inl.h:5709–5712  ·  view source on GitHub ↗

The OnAsyncWorkExecute method receives an napi_env argument. However, do NOT use it within this method, as it does not run on the JavaScript thread and must not run any method that would cause JavaScript to run. In practice, this means that almost any use of napi_env will be incorrect.

Source from the content-addressed store, hash-verified

5707// must not run any method that would cause JavaScript to run. In practice,
5708// this means that almost any use of napi_env will be incorrect.
5709inline void AsyncWorker::OnAsyncWorkExecute(napi_env env, void* asyncworker) {
5710 AsyncWorker* self = static_cast<AsyncWorker*>(asyncworker);
5711 self->OnExecute(env);
5712}
5713// The OnExecute method receives an napi_env argument. However, do NOT
5714// use it within this method, as it does not run on the JavaScript thread and
5715// must not run any method that would cause JavaScript to run. In practice,

Callers

nothing calls this directly

Calls 1

OnExecuteMethod · 0.95

Tested by

no test coverage detected