| 5733 | self->OnWorkComplete(env, status); |
| 5734 | } |
| 5735 | inline 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 |
no test coverage detected