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: fix return results description of napi_get_value_string_utf8 #14529

Closed
wants to merge 5 commits into from
Closed

doc: fix return results description of napi_get_value_string_utf8 #14529

wants to merge 5 commits into from

Conversation

taveras
Copy link

@taveras taveras commented Jul 28, 2017

The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

Fixes: #14398

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc, n-api

@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 Jul 28, 2017
doc/api/n-api.md Outdated
terminator. If the buffer size is insufficient, the string will be truncated
including a null terminator.
- `[out] result`: Number of bytes copied into the buffer, excluding the null
terminator.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the buffer size is insufficient, the string will be truncated including a null terminator.

I feel like this information should be represented somewhere, maybe as part of the bufsize parameter?

Copy link
Author

Choose a reason for hiding this comment

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

ah, yes! do you feel it may be best to keep this sentence within the [out] result description?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to move that sentence to be part of the [in] bufsize parameter comment. That's where it's relevant to call out that the string will be truncated, but still include a null terminator.

Copy link
Contributor

@kfarnung kfarnung left a comment

Choose a reason for hiding this comment

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

I think it's good to call out the possible truncation for inadequate buffer sizes. I don't think it belongs where it was though.

doc/api/n-api.md Outdated
- `[out] result`: Number of bytes copied into the buffer including the null.
terminator. If the buffer size is insufficient, the string will be truncated
including a null terminator.
- `[in] bufsize`: Size of the destination buffer. When this value is insufficient, the returned string will be truncated.
Copy link
Author

Choose a reason for hiding this comment

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

@kfarnung I added the details about the string truncation, but now under the bufsize line

Copy link
Member

Choose a reason for hiding this comment

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

nit: needs a line wrap at 80 chars :-)

Copy link
Author

Choose a reason for hiding this comment

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

doh, pushed a fix 😄

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
Copy link
Member

mhdawson commented Aug 18, 2017

@mhdawson
Copy link
Member

@taveras seems like there are now conflicts, can you rebase ?

@taveras
Copy link
Author

taveras commented Aug 18, 2017

@mhdawson i rebased the branch against master.

also, i added the same changes for the remaining napi_get_value_string_* methods,
as the original issue applied to the docs of all three methods

@mhdawson
Copy link
Member

@mhdawson
Copy link
Member

CI failure was unrelated, opened #14982

@mhdawson
Copy link
Member

Landing, sorry it took so long.

@mhdawson
Copy link
Member

Landed as 82bad0b. @taveras Thanks !

@mhdawson mhdawson closed this Aug 22, 2017
mhdawson pushed a commit that referenced this pull request Aug 22, 2017
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: #14529
Fixes: #14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: nodejs/node#14529
Fixes: nodejs/node#14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: nodejs/node#14529
Fixes: nodejs/node#14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: #14529
Fixes: #14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: #14529
Fixes: #14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 10, 2018
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: nodejs#14529
Fixes: nodejs#14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

Backport-PR-URL: #19447
PR-URL: #14529
Fixes: #14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 16, 2018
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.

7 participants