Skip to content

doc: NAPI napi_open_callback_scope - #25366

Closed
DaAitch wants to merge 1 commit into
nodejs:masterfrom
DaAitch:fix/doc_napi_open_callback_scope
Closed

doc: NAPI napi_open_callback_scope#25366
DaAitch wants to merge 1 commit into
nodejs:masterfrom
DaAitch:fix/doc_napi_open_callback_scope

Conversation

@DaAitch

Copy link
Copy Markdown
Contributor
  • parameter resource_object is mandatory
Checklist

Description

According to documentionnapi_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-botnodejs-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
DaAitchforce-pushed the fix/doc_napi_open_callback_scope branch from b83d610 to 94a5373CompareJanuary 6, 2019 12:25

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

@vsemozhetbyt

Copy link
Copy Markdown
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>
@BridgeARBridgeAR 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>
@MylesBorinsMylesBorins 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>
@BethGriggsBethGriggs 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.node-apiIssues and PRs related to the Node-API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@DaAitch@vsemozhetbyt@mhdawson@nodejs-github-bot