mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00: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:
@@ -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