Skip to content

doc: document unspecified behavior for buf.write* methods - #5925

Closed
jasnell wants to merge 2 commits into
nodejs:masterfrom
jasnell:buffer-write-doc
Closed

doc: document unspecified behavior for buf.write* methods#5925
jasnell wants to merge 2 commits into
nodejs:masterfrom
jasnell:buffer-write-doc

Conversation

@jasnell

Copy link
Copy Markdown
Member

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
@jasnelljasnell added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Mar 27, 2016
Comment threaddoc/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.

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.

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
Copy Markdown
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
Copy Markdown
Contributor

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

@jasnell

Copy link
Copy Markdown
MemberAuthor

@claudiorodriguez@benjamingr .. updated. PTAL

@claudiorodriguez

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

Landed in 64bf4b3

@jasnelljasnell 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>
@MylesBorinsMylesBorins mentioned this pull request Apr 11, 2016
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.

4 participants

@jasnell@claudiorodriguez@benjamingr@MylesBorins