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.

Backport-PR-URL: #19447
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 MylesBorins committed Apr 16, 2018
1 parent c685212 commit d4284a4
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 @@ -1228,7 +1228,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 @@ -1406,7 +1406,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 d4284a4

Please sign in to comment.