Skip to content

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 <[email protected]>
addaleax pushed a commit that referenced this pull request Jan 14, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <[email protected]>
@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 <[email protected]>
@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 <[email protected]>
@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 <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
- parameter `resource_object` is mandatory

PR-URL: #25366
Reviewed-By: Michael Dawson <[email protected]>
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