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: note that buf.buffer's contents might differ #29651

Closed
wants to merge 1 commit into from

Conversation

strugee
Copy link
Contributor

@strugee strugee commented Sep 22, 2019

This bit me in a personal project since I had no reason to read the buf.byteOffset docs, so point readers there explicitly.

Checklist

- [ ] make -j4 test (UNIX), or vcbuild test (Windows) passes
- [ ] tests and/or benchmarks are included

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Sep 22, 2019
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.
@@ -1025,6 +1025,9 @@ console.log(buf.toString('ascii'));
* {ArrayBuffer} The underlying `ArrayBuffer` object based on
which this `Buffer` object is created.

This `ArrayBuffer` is not guaranteed to correspond exactly to the original
`Buffer`. See the notes on `buf.byteOffset` for details.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`Buffer`. See the notes on `buf.byteOffset` for details.
`Buffer`. See the notes on [`buf.byteOffset`][] for details.

Add the following at the bottom:

[`buf.byteOffset`]: #buffer_buf_byteoffset

Copy link
Member

Choose a reason for hiding this comment

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

I think a better approach is to say that the Buffer is a view over a subset of the ArrayBuffer. It will correspond to that subset only starting at the byteOffset.

@Trott
Copy link
Member

Trott commented Sep 24, 2019

@nodejs/buffer @nodejs/documentation

@Trott
Copy link
Member

Trott commented Sep 29, 2019

This seems to have stalled, so I'm going to close it. If you plan on working revising this to get it landed, please re-open or leave a comment. Thanks!

@Trott Trott closed this Sep 29, 2019
@Trott
Copy link
Member

Trott commented Sep 29, 2019

Actually, I take it back. Re-opening....

@Trott Trott reopened this Sep 29, 2019
addaleax pushed a commit that referenced this pull request Nov 30, 2019
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@addaleax
Copy link
Member

Landed in 5833cfd

@addaleax addaleax closed this Nov 30, 2019
addaleax pushed a commit that referenced this pull request Nov 30, 2019
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BridgeAR BridgeAR mentioned this pull request Dec 3, 2019
targos pushed a commit that referenced this pull request Dec 5, 2019
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BethGriggs BethGriggs mentioned this pull request Dec 9, 2019
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@BethGriggs BethGriggs mentioned this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants