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: document unspecified behavior for buf.write* methods #5925

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Mar 27, 2016

Pull Request check-list

  • Is a documentation update included (if this change modifies
    existing APIs, or introduces new ones)?

Affected core subsystem(s)

doc/api/buffer.markdown

Description of change

Per #1161, when the buf.write*() methods are given anything other than what they expect, indicate that the behavior is unspecified.

Fixes: #1161

Per nodejs#1161, when the
buf.write*() methods are given anything other than what
they expect, indicate that the behavior is unspecified.

Fixes: nodejs#1161
@jasnell jasnell added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Mar 27, 2016
@@ -1397,7 +1397,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);

Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little
endian). The `value` argument must be a valid 64-bit double.
endian). The `value` argument *should* be a valid 64-bit double. Behavior is
unspecified if `value` is anything other than a 64-bit double.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe undefined is better than unspecified here? we're specifying that the behavior is undefined right here. That's what most other languages do (like C++).

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 "Behavior is not defined" would be better, since the word "undefined" might confuse basic level english speakers into thinking undefined will get written into the buffer somehow. Though TBH "unspecified" looks fine to me.

@claudiorodriguez
Copy link
Contributor

LGTM though we need some more people to weigh in on the choice of word (unspecified/undefined/not defined)

@jasnell jasnell force-pushed the buffer-write-doc branch from 4a3bc64 to 1aeb24f Compare April 2, 2016 03:47
@jasnell
Copy link
Member Author

jasnell commented Apr 2, 2016

@claudiorodriguez @benjamingr .. updated. PTAL

@claudiorodriguez
Copy link
Contributor

LGTM

jasnell added a commit that referenced this pull request Apr 3, 2016
Per #1161, when the
buf.write*() methods are given anything other than what
they expect, indicate that the behavior is unspecified.

Fixes: #1161
PR-URL: #5925
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
@jasnell
Copy link
Member Author

jasnell commented Apr 3, 2016

Landed in 64bf4b3

@jasnell jasnell closed this Apr 3, 2016
MylesBorins pushed a commit that referenced this pull request Apr 5, 2016
Per #1161, when the
buf.write*() methods are given anything other than what
they expect, indicate that the behavior is unspecified.

Fixes: #1161
PR-URL: #5925
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
This was referenced Apr 5, 2016
MylesBorins pushed a commit that referenced this pull request Apr 11, 2016
Per #1161, when the
buf.write*() methods are given anything other than what
they expect, indicate that the behavior is unspecified.

Fixes: #1161
PR-URL: #5925
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
@MylesBorins MylesBorins mentioned this pull request Apr 11, 2016
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.

4 participants