doc: document unspecified behavior for buf.write* methods#5925
Closed
jasnell wants to merge 2 commits intonodejs:masterfrom
Closed
doc: document unspecified behavior for buf.write* methods#5925jasnell wants to merge 2 commits intonodejs:masterfrom
jasnell wants to merge 2 commits intonodejs:masterfrom
Conversation
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
doc/api/buffer.markdown
Outdated
| 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. |
Member
There was a problem hiding this comment.
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++).
Contributor
There was a problem hiding this comment.
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.
Contributor
|
LGTM though we need some more people to weigh in on the choice of word (unspecified/undefined/not defined) |
4a3bc64 to
1aeb24f
Compare
Member
Author
|
@claudiorodriguez @benjamingr .. updated. PTAL |
Contributor
|
LGTM |
Member
Author
|
Landed in 64bf4b3 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request check-list
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