From c629553cd7b08ea9e56a55176583219ee19a8a86 Mon Sep 17 00:00:00 2001 From: "Bruce A. MacNaughton" Date: Thu, 10 Jan 2019 12:54:20 -0800 Subject: [PATCH] doc: minor doc corrections and clarifications - class_property_descriptor - Contructor => Constructor - object - returns *undefined* not NULL if key doesn't exist - object_wrap - Contructor => Constructor - property_descriptor - environemnt => environment PR-URL: https://github.com/nodejs/node-addon-api/pull/426 Reviewed-By: Michael Dawson Reviewed-By: NickNaso --- doc/class_property_descriptor.md | 4 ++-- doc/number.md | 1 - doc/object.md | 2 +- doc/object_wrap.md | 2 +- doc/property_descriptor.md | 2 +- tools/README.md | 4 ++-- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/class_property_descriptor.md b/doc/class_property_descriptor.md index 5df283491..7e81358e4 100644 --- a/doc/class_property_descriptor.md +++ b/doc/class_property_descriptor.md @@ -8,7 +8,7 @@ This prevents using descriptors from a different class when defining a new class ## Methods -### Contructor +### Constructor Creates new instance of `Napi::ClassPropertyDescriptor` descriptor object. @@ -33,4 +33,4 @@ Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi:: operator const napi_property_descriptor&() const { return _desc; } ``` -Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor` \ No newline at end of file +Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor` diff --git a/doc/number.md b/doc/number.md index f4fd584a9..7cf70ae27 100644 --- a/doc/number.md +++ b/doc/number.md @@ -39,7 +39,6 @@ Napi::Number Napi::Number::New(napi_env env, double value); - `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object. - `[in] value`: The C++ primitive from which to instantiate the `Napi::Number`. - Creates a new instance of a `Napi::Number` object. ### Int32Value diff --git a/doc/object.md b/doc/object.md index 3e32fa4e9..1935664b5 100644 --- a/doc/object.md +++ b/doc/object.md @@ -108,7 +108,7 @@ Napi::Value Napi::Object::Get(____ key); ``` - `[in] key`: The name of the property to return the value for. -Returns the [`Napi::Value`](value.md) associated with the key property. Returns NULL if no such key exists. +Returns the [`Napi::Value`](value.md) associated with the key property. Returns the value *undefined* if the key does not exist. The `key` can be any of the following types: - `napi_value` diff --git a/doc/object_wrap.md b/doc/object_wrap.md index 93773da69..5bc06c871 100644 --- a/doc/object_wrap.md +++ b/doc/object_wrap.md @@ -116,7 +116,7 @@ against the class constructor. ## Methods -### Contructor +### Constructor Creates a new instance of a JavaScript object that wraps native instance. diff --git a/doc/property_descriptor.md b/doc/property_descriptor.md index 82a87191f..324b62f74 100644 --- a/doc/property_descriptor.md +++ b/doc/property_descriptor.md @@ -192,7 +192,7 @@ static Napi::PropertyDescriptor Napi::PropertyDescriptor::Function ( void *data = nullptr); ``` -* `[in] env`: The environemnt in which to create this accessor. +* `[in] env`: The environment in which to create this accessor. * `[in] name`: The name of the Callable function. * `[in] cb`: The function * `[in] attributes`: Potential attributes for the getter function. diff --git a/tools/README.md b/tools/README.md index a711a808c..b71e5d92c 100644 --- a/tools/README.md +++ b/tools/README.md @@ -25,7 +25,7 @@ Here is the list of things that can be fixed easily. ### Major Reconstructions -The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associated wrapped object's instance methods to Javascript module instead of static methods like NAN. +The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN. So if you use Nan::ObjectWrap in your module, you will need to execute the following steps. @@ -39,7 +39,7 @@ and define it as ... } ``` -This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instanciated and `Napi::ObjectWrap` can use the `this` pointer to create reference to the wrapped object. +This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object. 2. Move your original constructor code into the new constructor. Delete your original constructor. 3. In your class initialization function, associate native methods in the following way. The `&` character before methods is required because they are not static methods but instance methods.