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 876e186

Browse filesBrowse files
Aonghus O NiaMylesBorins
authored andcommitted
doc: fix exporting a function example
Missing the length argument in napi_create_function. PR-URL: #18661 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 7b377cf commit 876e186
Copy full SHA for 876e186

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-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
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ For example, to set a function to be returned by the `require()` for the addon:
918918
napi_value Init(napi_env env, napi_value exports) {
919919
napi_value method;
920920
napi_status status;
921-
status = napi_create_function(env, "exports", Method, NULL, &method);
921+
status = napi_create_function(env, "exports", NAPI_AUTO_LENGTH, Method, NULL, &method);
922922
if (status != napi_ok) return NULL;
923923
return method;
924924
}

0 commit comments

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