Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
n-api: document that native strings are copied
Mention that a copy is made of the native string by the
napi_create_string_* APIs.

Fixes: nodejs/abi-stable-node#304
  • Loading branch information
Gabriel Schulhof committed Apr 30, 2018
commit 4f9590d8f93dc5414b8ab2b14ea9ca9779f21574
4 changes: 3 additions & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ napi_status napi_create_string_latin1(napi_env env,
Returns `napi_ok` if the API succeeded.

This API creates a JavaScript `String` object from a ISO-8859-1-encoded C
string.
string. The native string is copied.

The JavaScript `String` type is described in
[Section 6.1.4][] of the ECMAScript Language Specification.
Expand All @@ -1566,6 +1566,7 @@ napi_status napi_create_string_utf16(napi_env env,
Returns `napi_ok` if the API succeeded.

This API creates a JavaScript `String` object from a UTF16-LE-encoded C string.
The native string is copied.

The JavaScript `String` type is described in
[Section 6.1.4][] of the ECMAScript Language Specification.
Expand All @@ -1590,6 +1591,7 @@ if it is null-terminated.
Returns `napi_ok` if the API succeeded.

This API creates a JavaScript `String` object from a UTF8-encoded C string.
The native string is copied.

The JavaScript `String` type is described in
[Section 6.1.4][] of the ECMAScript Language Specification.
Expand Down