Skip to content

Commit

Permalink
doc: fix exporting a function example
Browse files Browse the repository at this point in the history
Missing the length argument in napi_create_function.

PR-URL: nodejs#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>
  • Loading branch information
Aonghus O Nia authored and Gabriel Schulhof committed Apr 16, 2018
1 parent 85728d1 commit 4950772
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,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

0 comments on commit 4950772

Please sign in to comment.