mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
n-api: factor out calling pattern
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: https://github.com/nodejs/node/pull/36113 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
187ce5bd06
commit
2fd22353ea
3 files changed
+21
-38
No files matched your search
+1
-4
@@ -1130,11 +1130,8 @@ napi_status napi_queue_async_work(napi_env env, napi_async_work work) {
|
||||
CHECK_ENV(env);
|
||||
CHECK_ARG(env, work);
|
||||
|
||||
napi_status status;
|
||||
uv_loop_t* event_loop = nullptr;
|
||||
status = napi_get_uv_event_loop(env, &event_loop);
|
||||
if (status != napi_ok)
|
||||
return napi_set_last_error(env, status);
|
||||
STATUS_CALL(napi_get_uv_event_loop(env, &event_loop));
|
||||
|
||||
uvimpl::Work* w = reinterpret_cast<uvimpl::Work*>(work);
|
||||
|
||||
|
||||
Reference in new issue
Block a user