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

doc: NAPI `napi_open_callback_scope` #25366

Closed

Conversation

@DaAitch
Copy link
Contributor

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.

doc: napi `napi_open_callback_scope`
- parameter `resource_object` is mandatory

@DaAitch DaAitch force-pushed the DaAitch:fix/doc_napi_open_callback_scope branch from b83d610 to 94a5373 Jan 6, 2019

@mhdawson
Copy link
Member

left a comment

LGTM since it documents current behavior.

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2019

Landed in 9e7d4ca
Thank you!

vsemozhetbyt added a commit that referenced this pull request Jan 13, 2019
doc: fix `napi_open_callback_scope` description
- parameter `resource_object` is mandatory

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

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

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

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

PR-URL: #25366
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins added a commit that referenced this pull request May 16, 2019
doc: fix `napi_open_callback_scope` description
- 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
Projects
None yet
4 participants
You can’t perform that action at this time.