-
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] napi_get_value_string_length
return length as type too small
#13458
Comments
That should probably be removed from the API documentation, it’s no longer part of what Node exports. Also, you’re right, and we do use |
Yes, that API was removed because it was ambiguous about the encoding used to determine the length, and it was redundant with See also #13469 about other areas the doc needs updating. |
I'll take a look at updating the docs tomorrow. |
PR-URL: nodejs#13508 Fixes: nodejs#13469 Fixes: nodejs#13458 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
As specified in the N-API documentation,
napi_get_value_string_length
returns the string length as anint
, but the JS spec mandates it to be an unsigned integer at most 253-1. It may be more appropriate here to return auint64_t
instead.(BTW, I use "return" loosely, in reference to its out parameter.)
The text was updated successfully, but these errors were encountered: