diff options
author | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2018-04-30 13:54:51 -0400 |
---|---|---|
committer | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2018-05-06 12:25:16 -0400 |
commit | 4692cf4ebba530b92b6c6aebc08fe9ddba5fb43d (patch) | |
tree | 4d45db01d4254c6bfa2e0deff9a6ccda4988b693 /doc/api/n-api.md | |
parent | 34bd9f318a164d6b2ee949793146b85b3e152d5f (diff) | |
download | android-node-v8-4692cf4ebba530b92b6c6aebc08fe9ddba5fb43d.tar.gz android-node-v8-4692cf4ebba530b92b6c6aebc08fe9ddba5fb43d.tar.bz2 android-node-v8-4692cf4ebba530b92b6c6aebc08fe9ddba5fb43d.zip |
doc: fix N-API property descriptor documentation
PR-URL: https://github.com/nodejs/node/pull/20433
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/n-api.md')
-rw-r--r-- | doc/api/n-api.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 12b3975022..17958c8daf 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -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; @@ -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), }; @@ -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, |