Skip to content

Commit c629553

Browse files
bmacnaughtonmhdawson
authored andcommitted
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: #426 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
1 parent 7b87e0b commit c629553

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

doc/class_property_descriptor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This prevents using descriptors from a different class when defining a new class
88

99
## Methods
1010

11-
### Contructor
11+
### Constructor
1212

1313
Creates new instance of `Napi::ClassPropertyDescriptor` descriptor object.
1414

@@ -33,4 +33,4 @@ Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::
3333
operator const napi_property_descriptor&() const { return _desc; }
3434
```
3535
36-
Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`
36+
Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`

doc/number.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Napi::Number Napi::Number::New(napi_env env, double value);
3939
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object.
4040
- `[in] value`: The C++ primitive from which to instantiate the `Napi::Number`.
4141

42-
4342
Creates a new instance of a `Napi::Number` object.
4443

4544
### Int32Value

doc/object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Napi::Value Napi::Object::Get(____ key);
108108
```
109109
- `[in] key`: The name of the property to return the value for.
110110

111-
Returns the [`Napi::Value`](value.md) associated with the key property. Returns NULL if no such key exists.
111+
Returns the [`Napi::Value`](value.md) associated with the key property. Returns the value *undefined* if the key does not exist.
112112

113113
The `key` can be any of the following types:
114114
- `napi_value`

doc/object_wrap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ against the class constructor.
116116

117117
## Methods
118118

119-
### Contructor
119+
### Constructor
120120

121121
Creates a new instance of a JavaScript object that wraps native instance.
122122

doc/property_descriptor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static Napi::PropertyDescriptor Napi::PropertyDescriptor::Function (
192192
void *data = nullptr);
193193
```
194194

195-
* `[in] env`: The environemnt in which to create this accessor.
195+
* `[in] env`: The environment in which to create this accessor.
196196
* `[in] name`: The name of the Callable function.
197197
* `[in] cb`: The function
198198
* `[in] attributes`: Potential attributes for the getter function.

tools/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Here is the list of things that can be fixed easily.
2525

2626

2727
### Major Reconstructions
28-
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.
28+
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.
2929

3030
So if you use Nan::ObjectWrap in your module, you will need to execute the following steps.
3131

@@ -39,7 +39,7 @@ and define it as
3939
...
4040
}
4141
```
42-
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.
42+
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.
4343

4444
2. Move your original constructor code into the new constructor. Delete your original constructor.
4545
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.

0 commit comments

Comments
 (0)