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

Added Call and MakeCallback that accept cargs as agruments #344

Closed
wants to merge 3 commits into from
Closed

Added Call and MakeCallback that accept cargs as agruments #344

wants to merge 3 commits into from

Conversation

NickNaso
Copy link
Member

Added methods to Napi::FunctionReference like requested and discussed on the issue #320

Below I report the added methods:

Napi::Value Call(napi_value recv, size_t argc, const napi_value* args) const;

Napi::Value MakeCallback(napi_value recv, size_t argc, const napi_value* args) const;

@mhdawson
Copy link
Member

Looks good, but the 2 methods need to be added to the doc as well.

@NickNaso
Copy link
Member Author

Ok added the requested documentation

@mhdawson mhdawson mentioned this pull request Sep 18, 2018
6 tasks
Copy link

@thefourtheye thefourtheye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few typos in the commit message as well.

@@ -148,6 +148,23 @@ arguments of the referenced function.
Returns a `Napi::Value` representing the JavaScript object returned by the referenced
function.

### Call

Calls a referenced Javascript function from a native add-on.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: JavaScript is used with different cases in the file.

```

- `[in] recv`: The `this` object passed to the referenced function when it's called.
- `[in] argc`: The number of the arguments passed to the referenced function.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The number of arguments

@NickNaso
Copy link
Member Author

@thefourtheye Fixed typos for the the methods added in this PR. I will provide to fix the remaining typos in this PR #335

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mhdawson pushed a commit that referenced this pull request Sep 20, 2018
PR-URL: #344
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@mhdawson
Copy link
Member

Landed as 97c4ab5

@mhdawson mhdawson closed this Sep 20, 2018
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
PR-URL: nodejs/node-addon-api#344
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
PR-URL: nodejs/node-addon-api#344
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
PR-URL: nodejs/node-addon-api#344
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
PR-URL: nodejs/node-addon-api#344
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants