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: fix example in stream doc #8378

Closed
wants to merge 1 commit into from
Closed

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Sep 2, 2016

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Description of change

If chunk is a buffer chunk.toString(encoding) throws an error as 'buffer' is not a valid encoding. This fixes the documentation bug by not using the encoding argument.

Fixes: #8085

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Sep 2, 2016
Fix cases where `chunk` is a buffer.

PR-URL: nodejs#8378
Fixes: nodejs#8085
chunk = chunk.toString(encoding);
this[kSource].writeSomeData(chunk, encoding);
chunk = chunk.toString();
this[kSource].writeSomeData(chunk);
Copy link
Member Author

@lpinca lpinca Sep 2, 2016

Choose a reason for hiding this comment

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

The assumption here is that encoding is optional.

Copy link
Member

@imyller imyller left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

@addaleax
Copy link
Member

LGTM. I’ll start landing this:

  • Three LGTMs
  • No objections
  • No requested changes
  • CI doesn’t apply to docs-only changes

@addaleax
Copy link
Member

Landed in 7f71419

@addaleax addaleax closed this Sep 24, 2016
addaleax pushed a commit that referenced this pull request Sep 24, 2016
Fix cases where `chunk` is a buffer.

PR-URL: #8378
Fixes: #8085
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@lpinca lpinca deleted the gh-8085 branch September 24, 2016 21:17
jasnell pushed a commit that referenced this pull request Sep 29, 2016
Fix cases where `chunk` is a buffer.

PR-URL: #8378
Fixes: #8085
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
geek pushed a commit to geek/node that referenced this pull request Sep 30, 2016
Fix cases where `chunk` is a buffer.

PR-URL: nodejs#8378
Fixes: nodejs#8085
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
Fix cases where `chunk` is a buffer.

PR-URL: #8378
Fixes: #8085
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error at code example of Duplex Stream in Docs
6 participants