stream: use more explicit statements

Using objectMode with stream_wrap has not worked properly
before and would end in an error.
Therefore prohibit the usage of objectMode alltogether.

This also improves the handling performance due to the
cheaper chunk check and by using explicit statements as they
produce better code from the compiler.

PR-URL: https://github.com/nodejs/node/pull/13863
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Ruben Bridgewater authored and Matteo Collina committed 2017-06-29 18:03:54 +02:00
1 parent a1ecdcfb15
commit 1b54371c50
5 files changed
+40 -23

No files matched your search

+4 -3
View File
@@ -829,10 +829,11 @@ Node.js does not allow `stdout` or `stderr` Streams to be closed by user code.
Used when an attempt is made to close the `process.stdout` stream. By design,
Node.js does not allow `stdout` or `stderr` Streams to be closed by user code.
<a id="ERR_STREAM_HAS_STRINGDECODER"></a>
### ERR_STREAM_HAS_STRINGDECODER
<a id="ERR_STREAM_WRAP"></a>
### ERR_STREAM_WRAP
Used to prevent an abort if a string decoder was set on the Socket.
Used to prevent an abort if a string decoder was set on the Socket or if in
`objectMode`.
Example
```js