Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor doc fixes #426

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/class_property_descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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`
Returns the original N-API `napi_property_descriptor` wrapped inside the `Napi::ClassPropertyDescriptor`
4 changes: 2 additions & 2 deletions doc/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Creates a new instance of a `Napi::Number` object.
Napi::Number(napi_env env, napi_value value);
```

- `[in] env`: The `napi_env` environment in which to construct the `Napi::Nuber` object.
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object.
- `[in] value`: The `napi_value` which is a handle for a JavaScript `Number`.

Returns a non-empty `Napi::Number` object.
Expand All @@ -36,7 +36,7 @@ Napi::Number(napi_env env, napi_value value);
```cpp
Napi::Number Napi::Number::New(napi_env env, double value);
```
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Nuber` object.
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object.
- `[in] value`: The `napi_value` which is a handle for a JavaScript `Number`.

Creates a new instance of a `Napi::Number` object.
Expand Down
2 changes: 1 addition & 1 deletion doc/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion doc/object_wrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ against the class constructor.

## Methods

### Contructor
### Constructor

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

Expand Down
2 changes: 1 addition & 1 deletion doc/property_descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down