Convert all locals and parameter names to snake_case #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Standardize some parameter names across the N-API surface such as
napi_env env
andsize_t length
. Make all the parameter names in the header match the cc file and expand some parameter names from single characters into meaningful words.Also addresses a couple of minor PR feedback items:
napi_reference_addref
andnapi_reference_release
tonapi_reference_ref
andnapi_reference_unref
(respectively)Reference::AddRef
andReference::Release
toReference::Ref
andReference::Unref
(respectively)napi_create_boolean
,napi_get_true
, andnapi_get_false
and replace them withnapi_get_boolean
napi_get_type_of_value
tonapi_typeof
result_data
out parameter tonapi_create_buffer_copy
which returns the data pointer of the new buffernapi_get_value_string_utf8
andnapi_get_value_string_utf16
to accept a null output buffer and return the length of the source string in that case via theresult
parameternapi_get_value_string_utf8_length
andnapi_get_value_string_utf16_length
due to the aboveReference
ctor and dtor to be protected and added publicstatic Reference* Reference::New
andstatic void Reference::Delete
methods to make it more clear how theReference
objects are allocated and cleaned-upnapi_get_array_length
which returns an error if the argument is not an array objectnapi_create_symbol
to take anapi_value
instead of aconst char*
for the symbol description string. The API now throws if description is not a string but NULL is allowed.Addresses #189 and #188 and some feedback in nodejs/node#11975.