-
Notifications
You must be signed in to change notification settings - Fork 30k
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
n-api: factor out calling pattern #36113
Conversation
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]>
Review requested:
|
v8impl::V8NameFromPropertyDescriptor(env, p, &property_name); | ||
|
||
if (status != napi_ok) { | ||
return napi_set_last_error(env, status); |
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.
STATUS_CALL
simply returns on non-napi_ok
without calling napi_set_last_error
. The behavior seems not equivalent with the change. Is this intentional?
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.
@legendecas yes, it is, because it is assumed that whichever call returned non-napi_ok
did so via return napi_set_last_error(napi_<not_ok>);
I checked to make sure that was the case in all locations where I made the change.
Remove semicolon from macro definition Co-authored-by: Anna Henningsen <[email protected]>
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #36113 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Landed in 2fd2235. |
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #36113 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #36113 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #36113 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Factor out how we handle a `napi_status`-valued return internally. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #36113 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Factor out how we handle a
napi_status
-valued return internally.Signed-off-by: Gabriel Schulhof [email protected]
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes