Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ac491b

Browse filesBrowse files
Gabriel SchulhofMylesBorins
authored andcommitted
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 PR-URL: #20425 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
1 parent d7557e1 commit 7ac491b
Copy full SHA for 7ac491b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+3-1Lines changed: 3 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ napi_status napi_create_string_latin1(napi_env env,
15411541
Returns `napi_ok` if the API succeeded.
15421542

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

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

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

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

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.