Skip to content

Commit e94deb8

Browse files
Gabriel SchulhofMylesBorins
Gabriel Schulhof
authored andcommitted
doc: fix N-API property descriptor documentation
PR-URL: #20433 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 55af327 commit e94deb8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

doc/api/n-api.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,7 @@ provided by the addon:
915915
napi_value Init(napi_env env, napi_value exports) {
916916
napi_status status;
917917
napi_property_descriptor desc =
918-
{"hello", Method, 0, 0, 0, napi_default, 0};
919-
if (status != napi_ok) return NULL;
918+
{"hello", NULL, Method, NULL, NULL, NULL, napi_default, NULL};
920919
status = napi_define_properties(env, exports, 1, &desc);
921920
if (status != napi_ok) return NULL;
922921
return exports;
@@ -943,7 +942,7 @@ To define a class so that new instances can be created (often used with
943942
napi_value Init(napi_env env, napi_value exports) {
944943
napi_status status;
945944
napi_property_descriptor properties[] = {
946-
{ "value", NULL, GetValue, SetValue, 0, napi_default, 0 },
945+
{ "value", NULL, NULL, GetValue, SetValue, NULL, napi_default, NULL },
947946
DECLARE_NAPI_METHOD("plusOne", PlusOne),
948947
DECLARE_NAPI_METHOD("multiply", Multiply),
949948
};
@@ -2405,8 +2404,8 @@ if (status != napi_ok) return status;
24052404

24062405
// Set the properties
24072406
napi_property_descriptor descriptors[] = {
2408-
{ "foo", NULL, 0, 0, 0, fooValue, napi_default, 0 },
2409-
{ "bar", NULL, 0, 0, 0, barValue, napi_default, 0 }
2407+
{ "foo", NULL, NULL, NULL, NULL, fooValue, napi_default, NULL },
2408+
{ "bar", NULL, NULL, NULL, NULL, barValue, napi_default, NULL }
24102409
}
24112410
status = napi_define_properties(env,
24122411
obj,

0 commit comments

Comments
 (0)