From 1c62ac324413e0e23e448db6afd40bb87fa069c4 Mon Sep 17 00:00:00 2001 From: Fumiya KARASAWA Date: Fri, 23 Dec 2016 00:56:31 +0900 Subject: [PATCH 1/2] doc: fix a wrong expression about decodeStrings in stream When decodeStrings is false and given data is string, _write() function receives the string data not `Buffer`. --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 881bb2c6294258..8716c32d429290 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1273,8 +1273,8 @@ If the `decodeStrings` property is set in the constructor options, then indicate the character encoding of the string. This is to support implementations that have an optimized handling for certain string data encodings. If the `decodeStrings` property is explicitly set to `false`, -the `encoding` argument can be safely ignored, and `chunk` will always be a -`Buffer`. +the `encoding` argument can be safely ignored, and `chunk` will remain the same +object that is passed to `.write()`. The `writable._write()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by From 404222ada564f2dfeff59e0577f4dd7a27b6cf4a Mon Sep 17 00:00:00 2001 From: Fumiya KARASAWA Date: Fri, 23 Dec 2016 00:58:44 +0900 Subject: [PATCH 2/2] doc: fix a trivial mistake, expected -> unexpected In this context, 'expected' looks strange word. --- doc/api/stream.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 8716c32d429290..291cda735aee3d 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1503,9 +1503,9 @@ Implementers, and only from within the `readable._read()` method. It is recommended that errors occurring during the processing of the `readable._read()` method are emitted using the `'error'` event rather than being thrown. Throwing an Error from within `readable._read()` can result in -expected and inconsistent behavior depending on whether the stream is operating -in flowing or paused mode. Using the `'error'` event ensures consistent and -predictable handling of errors. +unexpected and inconsistent behavior depending on whether the stream is +operating in flowing or paused mode. Using the `'error'` event ensures +consistent and predictable handling of errors. ```js const Readable = require('stream').Readable;