mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: fix exporting a function example
Missing the length argument in napi_create_function. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
c90b77ed5d
commit
e9e5d56121
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user