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

buffer: documentation incorrect #5682

Closed
fb55 opened this issue Mar 13, 2016 · 4 comments
Closed

buffer: documentation incorrect #5682

fb55 opened this issue Mar 13, 2016 · 4 comments
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Comments

@fb55
Copy link
Contributor

fb55 commented Mar 13, 2016

The documentation of writeU?Int(8|((16|32)[BL]E))? states that the return value is the number of bytes written, while it actually is the offset plus this number.

This is inconsistent with a plain write, which returns only the bytes written, so before sending a PR, I wanted to ask which option is preferred: Correct the code (which might break modules & backwards compatibility) or fix the documentation.

@mscdex mscdex added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Mar 13, 2016
@mscdex
Copy link
Contributor

mscdex commented Mar 13, 2016

IMHO I think fixing the documentation would be best (for now).

@thefourtheye
Copy link
Contributor

cc @trevnorris

@trevnorris
Copy link
Contributor

This is definitely a documentation issue. That documentation addition was added in 6ad1f7b on Jan 25, 2016. While the feature of returning the offset after write was originally added in 4a34c69 on Jul 12, 2013 (pr: nodejs/node-v0.x-archive#5843).

@MylesBorins
Copy link
Contributor

Closing as 939d6ef has landed

abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this issue May 5, 2024
Fixes: https:github.com/nodejs/node/issues/5682
PR-URL: nodejs/node#5736
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this issue May 5, 2024
Fixes: https:github.com/nodejs/node/issues/5682
PR-URL: nodejs/node#5736
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
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

No branches or pull requests

5 participants