Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@DaAitch
Copy link
Contributor

@DaAitch DaAitch commented Jan 6, 2019

  • parameter resource_object is mandatory
Checklist

Description

According to documention napi_open_callback_scope's parameter resource_object is optional.

[in] resource_object: An optional object associated with the async work that will be passed to possible async_hooks init hooks.

, but when I do this:

status = napi_open_callback_scope(env, nullptr, async_context, &scope);

I get napi_invalid_arg and when I do this:

status = napi_open_callback_scope(env, resource_object, async_context, &scope);

it's napi_ok, so I checked impl and found this in node_api.cc:

v8::Local<v8::Object> resource;
CHECK_TO_OBJECT(env, context, resource, resource_object);

which makes me think that documentation is wrong, so here the PR for documentation.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API. labels Jan 6, 2019
- parameter `resource_object` is mandatory
@DaAitch DaAitch force-pushed the fix/doc_napi_open_callback_scope branch from b83d610 to 94a5373 Compare January 6, 2019 12:25
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 since it documents current behavior.

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt
Copy link
Contributor

Landed in 9e7d4ca
Thank you!

vsemozhetbyt pushed a commit that referenced this pull request Jan 13, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
addaleax pushed a commit that referenced this pull request Jan 14, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
- parameter `resource_object` is mandatory

PR-URL: nodejs#25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
BethGriggs pushed a commit that referenced this pull request Apr 28, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@BethGriggs BethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request May 10, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
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

doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.