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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: MichaëZasso <[email protected]>
  • 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.