Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f177e7

Browse filesBrowse files
陈刚addaleax
authored andcommitted
doc: readable.push(undefined) in non-object mode
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: #18283 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 2282dce commit 6f177e7
Copy full SHA for 6f177e7

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,10 @@ class SourceWrapper extends Readable {
17491749
*Note*: The `readable.push()` method is intended be called only by Readable
17501750
Implementers, and only from within the `readable._read()` method.
17511751

1752+
For streams not operating in object mode, if the `chunk` parameter of
1753+
`readable.push()` is `undefined`, it will be treated as empty string or
1754+
buffer. See [`readable.push('')`][] for more information.
1755+
17521756
#### Errors While Reading
17531757

17541758
It is recommended that errors occurring during the processing of the
@@ -2264,6 +2268,7 @@ contain multi-byte characters.
22642268
[`stream.uncork()`]: #stream_writable_uncork
22652269
[`stream.unpipe()`]: #stream_readable_unpipe_destination
22662270
[`stream.wrap()`]: #stream_readable_wrap_stream
2271+
[`readable.push('')`]: #stream_readable_push
22672272
[`writable.cork()`]: #stream_writable_cork
22682273
[`writable.uncork()`]: #stream_writable_uncork
22692274
[`zlib.createDeflate()`]: zlib.html#zlib_zlib_createdeflate_options

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.