Skip to content

Commit

Permalink
n-api: use nullptr instead of NULL in node_api.cc
Browse files Browse the repository at this point in the history
This commit changes two checks which use NULL to use nullptr.

I'm not very familiar with N-API but wanted to bring this up in case
it was something that was overlooked.

PR-URL: #17276
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: MichaëZasso <targos@protonmail.com>
  • Loading branch information
danbev authored and gibfahn committed Dec 20, 2017
1 parent 64b7398 commit b0da03b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ napi_status napi_delete_property(napi_env env,
v8::Maybe<bool> delete_maybe = obj->Delete(context, k);
CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure);

if (result != NULL)
if (result != nullptr)
*result = delete_maybe.FromMaybe(false);

return GET_RETURN_STATUS(env);
Expand Down Expand Up @@ -1395,7 +1395,7 @@ napi_status napi_delete_element(napi_env env,
v8::Maybe<bool> delete_maybe = obj->Delete(context, index);
CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure);

if (result != NULL)
if (result != nullptr)
*result = delete_maybe.FromMaybe(false);

return GET_RETURN_STATUS(env);
Expand Down

0 comments on commit b0da03b

Please sign in to comment.