MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / OnWorkComplete

Method OnWorkComplete

napi-inl.h:5735–5750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5733 self->OnWorkComplete(env, status);
5734}
5735inline void AsyncWorker::OnWorkComplete(Napi::Env env, napi_status status) {
5736 if (status != napi_cancelled) {
5737 HandleScope scope(_env);
5738 details::WrapCallback(env, [&] {
5739 if (_error.size() == 0) {
5740 OnOK();
5741 } else {
5742 OnError(Error::New(_env, _error));
5743 }
5744 return nullptr;
5745 });
5746 }
5747 if (!_suppress_destruct) {
5748 Destroy();
5749 }
5750}
5751
5752#endif // NAPI_HAS_THREADS
5753

Callers 1

OnAsyncWorkCompleteMethod · 0.95

Calls 2

WrapCallbackFunction · 0.85
ReleaseMethod · 0.45

Tested by

no test coverage detected