Skip to content

doc: fix a few n-api doc issues - #13650

Closed
mhdawson wants to merge 2 commits into
nodejs:masterfrom
mhdawson:napi-doc20
Closed

doc: fix a few n-api doc issues#13650
mhdawson wants to merge 2 commits into
nodejs:masterfrom
mhdawson:napi-doc20

Conversation

@mhdawson

Copy link
Copy Markdown
Member
  • Add doc for napi_create_string_latin1().
  • Fix signatures where c string was specified instead of napi_value.
  • Fix return type of napi_callback.
  • Update to specify that napi_escape_handle() can only be called once
    for a given scope.

Fixes: #13555
Fixes: #13556
Fixes: #13562

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-botnodejs-github-bot added doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API. labels Jun 13, 2017
Comment threaddoc/api/n-api.md Outdated

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.

This was already fixed in #13570. You'll need to rebase.

Comment threaddoc/api/n-api.md Outdated

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.

once per scope ?

Comment threaddoc/api/n-api.md Outdated

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.

Just noticed - this should say length in bytes, not characters.

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.

Also fix the doc for the length parameter of napi_create_string_utf16. That length is in two-byte code units, not characters. (GitHub won't let me put a comment on that line.)

Comment threaddoc/api/n-api.md Outdated

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.

Length in bytes. While in the case of Latin1 a character is always one byte, I think bytes is clearer in case someone is not familiar with the encoding.

@jasonginjasongin 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.

Left some comments.

Comment threaddoc/api/n-api.md Outdated

@RReverserRReverserJun 14, 2017

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.

typo: "references"

Comment threaddoc/api/n-api.md Outdated

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.

Same typo.

- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
Fixes: nodejs#13555Fixes: nodejs#13556Fixes: nodejs#13562
@mhdawson

Copy link
Copy Markdown
MemberAuthor

@jasongin, @RReverser thanks for the comments. Rebased and pushed commit to address.

@RReverser
RReverser self-requested a review June 15, 2017 10:52
@mhdawson

Copy link
Copy Markdown
MemberAuthor

@mhdawson

Copy link
Copy Markdown
MemberAuthor

CI run looks ok. Arm failure was unrelated, a problem doing checkout. Going to land.

@mhdawson

Copy link
Copy Markdown
MemberAuthor

Landed as 62e940d

mhdawson added a commit that referenced this pull request Jun 16, 2017
- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
PR-URL: #13650Fixes: #13555Fixes: #13556Fixes: #13562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
addaleax pushed a commit that referenced this pull request Jun 17, 2017
- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
PR-URL: #13650Fixes: #13555Fixes: #13556Fixes: #13562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
@addaleaxaddaleax mentioned this pull request Jun 17, 2017
addaleax pushed a commit that referenced this pull request Jun 21, 2017
- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
PR-URL: #13650Fixes: #13555Fixes: #13556Fixes: #13562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
@addaleaxaddaleax mentioned this pull request Jun 21, 2017
@mhdawson
mhdawson deleted the napi-doc20 branch June 28, 2017 19:23
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 10, 2018
- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
PR-URL: nodejs#13650Fixes: nodejs#13555Fixes: nodejs#13556Fixes: nodejs#13562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
- Add doc for napi_create_string_latin1().
- Fix signatures where c string was specified instead of napi_value.
- Fix return type of napi_callback.
- Update to specify that napi_escape_handle() can only be called once
for a given scope.
Backport-PR-URL: #19447
PR-URL: #13650Fixes: #13555Fixes: #13556Fixes: #13562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
@MylesBorinsMylesBorins mentioned this pull request Apr 16, 2018
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.

7 participants

@mhdawson@jasnell@RReverser@cjihrig@jasongin@MylesBorins@nodejs-github-bot