-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for N-API async changes #10
Conversation
napi-inl.h
Outdated
@@ -1316,15 +1322,15 @@ inline T Reference<T>::Value() const { | |||
|
|||
template <typename T> | |||
inline int Reference<T>::Ref() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either the type is wrong or result
needs a typecast before returning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here and a few other places.
napi-inl.h
Outdated
@@ -1316,15 +1322,15 @@ inline T Reference<T>::Value() const { | |||
|
|||
template <typename T> | |||
inline int Reference<T>::Ref() { | |||
int result; | |||
uint32_t result; | |||
napi_status status = napi_reference_ref(_env, _ref, &result); | |||
if (status != napi_ok) throw Error::New(_env); | |||
return result; | |||
} | |||
|
|||
template <typename T> | |||
inline int Reference<T>::Unref() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either the type is wrong or result
needs a typecast before returning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@boingoing What is the plan for getting the async APIs into node? Anyway, I don't see any point in holding this PR until those changes land, because the current code in this repo references the old N-API async functions that never landed in node. So updating this repo won't make things any worse. |
Prepping the PR for these changes as well as the one which changes Agreed, no reason to hold on the changes in this PR here. |
Updates for pending changes in async APIs at nodejs/abi-stable-node#204, along with other recent changes.
napi_work
tonapi_async_work
env
parameter and return anapi_status
napi_cancel_async_work()
APIError
object for async work errors, rather than just an error message.napi_status