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
fix exporting a function example
missing the length argument in napi_create_function
  • Loading branch information
Aonghus O Nia
Aonghus O Nia authored Feb 8, 2018
commit 55d54b23f33431ed0e570772668754627c657ca9
2 changes: 1 addition & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ For example, to set a function to be returned by the `require()` for the addon:
napi_value Init(napi_env env, napi_value exports) {
napi_value method;
napi_status status;
status = napi_create_function(env, "exports", Method, NULL, &method);
status = napi_create_function(env, "exports", NAPI_AUTO_LENGTH, Method, NULL, &method);
if (status != napi_ok) return NULL;
return method;
}
Expand Down