diff options
author | rebornix <penn.lv@gmail.com> | 2017-09-23 21:30:28 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-09-26 08:59:27 -0700 |
commit | 8b902500cddce129dda59f7d78b6bc8b62f13cb6 (patch) | |
tree | 615817756481da683c81f30f4105dd4563153dce /doc | |
parent | f98687db4a95450965a503c63982657a61fd49b2 (diff) | |
download | android-node-v8-8b902500cddce129dda59f7d78b6bc8b62f13cb6.tar.gz android-node-v8-8b902500cddce129dda59f7d78b6bc8b62f13cb6.tar.bz2 android-node-v8-8b902500cddce129dda59f7d78b6bc8b62f13cb6.zip |
doc: fix outdated code sample in n-api.md
code samples of napi_create_object and napi_property_descriptor were
not updated to latest API.
PR-URL: https://github.com/nodejs/node/pull/15581
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/n-api.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 08788765d2..13ec0f3594 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2349,7 +2349,7 @@ napi_status status = napi_status_generic_failure; // const obj = {}; napi_value obj; -status = napi_create_obj(env, &obj); +status = napi_create_object(env, &obj); if (status != napi_ok) return status; // Create napi_values for 123 and 456 @@ -2360,9 +2360,9 @@ status = napi_create_int32(env, 456, &barValue); if (status != napi_ok) return status; // Set the properties -napi_property_descriptors descriptors[] = { - { "foo", fooValue, 0, 0, 0, napi_default, 0 }, - { "bar", barValue, 0, 0, 0, napi_default, 0 } +napi_property_descriptor descriptors[] = { + { "foo", nullptr, 0, 0, 0, fooValue, napi_default, 0 }, + { "bar", nullptr, 0, 0, 0, barValue, napi_default, 0 } } status = napi_define_properties(env, obj, |