Skip to content

Commit

Permalink
doc: fix N-API property descriptor documentation
Browse files Browse the repository at this point in the history
PR-URL: #20433
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Gabriel Schulhof authored and MylesBorins committed May 9, 2018
1 parent 16970ff commit 880772a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,7 @@ provided by the addon:
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_property_descriptor desc =
{"hello", Method, 0, 0, 0, napi_default, 0};
if (status != napi_ok) return NULL;
{"hello", NULL, Method, NULL, NULL, NULL, napi_default, NULL};
status = napi_define_properties(env, exports, 1, &desc);
if (status != napi_ok) return NULL;
return exports;
Expand All @@ -943,7 +942,7 @@ To define a class so that new instances can be created (often used with
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_property_descriptor properties[] = {
{ "value", NULL, GetValue, SetValue, 0, napi_default, 0 },
{ "value", NULL, NULL, GetValue, SetValue, NULL, napi_default, NULL },
DECLARE_NAPI_METHOD("plusOne", PlusOne),
DECLARE_NAPI_METHOD("multiply", Multiply),
};
Expand Down Expand Up @@ -2405,8 +2404,8 @@ if (status != napi_ok) return status;

// Set the properties
napi_property_descriptor descriptors[] = {
{ "foo", NULL, 0, 0, 0, fooValue, napi_default, 0 },
{ "bar", NULL, 0, 0, 0, barValue, napi_default, 0 }
{ "foo", NULL, NULL, NULL, NULL, fooValue, napi_default, NULL },
{ "bar", NULL, NULL, NULL, NULL, barValue, napi_default, NULL }
}
status = napi_define_properties(env,
obj,
Expand Down

0 comments on commit 880772a

Please sign in to comment.