Skip to content

doc: note that buf.buffer's contents might differ - #29651

Closed
strugee wants to merge 1 commit into
nodejs:masterfrom
strugee:patch-2
Closed

doc: note that buf.buffer's contents might differ#29651
strugee wants to merge 1 commit into
nodejs:masterfrom
strugee:patch-2

Conversation

@strugee

Copy link
Copy Markdown
Contributor

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-botnodejs-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.
Comment threaddoc/api/buffer.md
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@nodejs/buffer @nodejs/documentation

@Trott

Copy link
Copy Markdown
Member

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!

@TrottTrott closed this Sep 29, 2019
@Trott

Copy link
Copy Markdown
Member

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

@TrottTrott 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
Copy Markdown
Member

Landed in 5833cfd

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>
@BridgeARBridgeAR 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>
@BethGriggsBethGriggs 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>
@BethGriggsBethGriggs mentioned this pull request Dec 23, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@strugee@Trott@addaleax@jasnell@trivikr@nodejs-github-bot