Commit Graph

277 Commits

Author SHA1 Message Date
Luigi Pinca
2b32985c62
stream: use null for the error argument
When no error occurs, use `null` instead of `undefined` for the `error`
argument of the `writable.write()` and `writable.end()` callbacks.

Fixes: https://github.com/nodejs/node/issues/44290
PR-URL: https://github.com/nodejs/node/pull/44312
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-08-23 07:51:53 +00:00
Antoine du Hamel
d7f193434a
lib: add Promise methods to avoid-prototype-pollution lint rule
PR-URL: https://github.com/nodejs/node/pull/43849
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2022-07-26 23:38:24 +01:00
Robert Nagy
31d9edc849
stream: fix 0 transform hwm backpressure
PR-URL: https://github.com/nodejs/node/pull/43685
Refs: https://github.com/nodejs/node/issues/42457
Refs: https://github.com/nodejs/node/pull/43648/files
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2022-07-24 13:55:11 +02:00
txxnano
99b109f7f3
stream: initial approach to include strategy options on Readable.toWeb()
PR-URL: https://github.com/nodejs/node/pull/43515
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-07-13 11:14:38 +01:00
Robert Nagy
e4bf5dc581
stream: finish pipeline if dst closes before src
If the destination stream is closed before the source has completed
the pipeline should finnish with premature close.

Fixes: https://github.com/nodejs/node/issues/43682

PR-URL: https://github.com/nodejs/node/pull/43701
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-07-11 11:25:05 +01:00
Giacomo Gregoletto
51beb26a5f
stream: pass error on legacy destroy
PR-URL: https://github.com/nodejs/node/pull/43519
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-06-28 09:59:24 +01:00
Node.js GitHub Bot
9c3c66b499
tools: update eslint to 8.18.0
PR-URL: https://github.com/nodejs/node/pull/43479
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-06-19 19:39:41 +01:00
LiviaMedeiros
a0178a1169
stream: use kEmptyObject
PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-06-11 12:18:14 +02:00
Antoine du Hamel
06d8606960
lib: use null-prototype objects for property descriptors
Refs: https://github.com/nodejs/node/pull/42921

PR-URL: https://github.com/nodejs/node/pull/43270
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-06-03 09:23:58 +01:00
Robert Nagy
58e645de63
stream: remove thenable support
Remove support for returning thenables in stream
implementation methods. This is causing more confusion
and issues than it's worth.

Refs: https://github.com/nodejs/node/issues/39535

PR-URL: https://github.com/nodejs/node/pull/40773
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-08 11:29:24 +01:00
Khoo Hao Yit
6d3920d579
stream: do cleanup when iterator is destroyed
PR-URL: https://github.com/nodejs/node/pull/42320
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-03-16 17:45:45 +00:00
Robert Nagy
1b47866a1d
stream: allow returning null from pipeline tail
PR-URL: https://github.com/nodejs/node/pull/42078
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2022-02-25 13:31:20 +00:00
Benjamin Gruenbaum
fd3997bcc9
stream: port more test262 tests
Add some test262 tests for `every`, add some `length` checks.

Turns out properties need to be writable after all according to the
test262 tests.

PR-URL: https://github.com/nodejs/node/pull/41974
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-23 21:06:00 +00:00
Xuguang Mei
9fb7ac3bbd
stream: need to cleanup event listeners if last stream is readable
fix: https://github.com/nodejs/node/issues/35452

PR-URL: https://github.com/nodejs/node/pull/41954
Fixes: https://github.com/nodejs/node/issues/35452
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-02-15 10:15:14 +00:00
Mohammed Keyvanzadeh
849fb70e29 stream: avoid usage of deprecated APIs
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: https://github.com/nodejs/node/pull/41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-02-11 11:47:10 +00:00
Mohammed Keyvanzadeh
717de17fad stream: refactor to use more validators
Use more validators where appropriate for consistency.

PR-URL: https://github.com/nodejs/node/pull/41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-02-11 11:47:09 +00:00
Mohammed Keyvanzadeh
ad6cd7fa9c stream: use standard for loop instead of for..of
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: https://github.com/nodejs/node/pull/41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-02-11 11:47:09 +00:00
Jithil P Ponnan
fe7ca085a7
stream: throw invalid arg type from End Of Stream
PR-URL: https://github.com/nodejs/node/pull/41766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-02-10 21:34:59 +00:00
linkgoron
42ad4137aa
stream: add iterator helper find
Continue iterator-helpers work by adding `find` to readable streams.

PR-URL: https://github.com/nodejs/node/pull/41849
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-02-07 07:24:17 +00:00
Robert Nagy
224b78ff06
stream: resume stream on drain
Previously we would just resume "flowing" the stream without
reseting the "paused" state. Fixes this by properly using
pause/resume methods for .pipe.

Fixes: https://github.com/nodejs/node/issues/41785

PR-URL: https://github.com/nodejs/node/pull/41848
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-02-06 10:05:51 +00:00
Benjamin Gruenbaum
662fb5f832
stream: initial port of test262 tests
PR-URL: https://github.com/nodejs/node/pull/41775
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-02-05 16:47:46 +00:00
Mohammed Keyvanzadeh
8c4b8b201a
lib: replace validator and error
Refs: https://github.com/nodejs/node/pull/41660

PR-URL: https://github.com/nodejs/node/pull/41678
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-02-05 08:36:48 -08:00
iMoses
06625ff0a6
stream: use synchronous error validation & validate abort signal option
made sure top level methods aren't async/generators
so that validation errors could be caught synchronously
also added validation for the abort signal option

PR-URL: https://github.com/nodejs/node/pull/41777
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
2022-02-03 10:55:05 +00:00
Benjamin Gruenbaum
d2ac192351
stream: add reduce
PR-URL: https://github.com/nodejs/node/pull/41669
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-30 14:07:32 +00:00
iMoses
5d9caa1c2f
stream: use synchronous error validation on iteration helpers
is no longer a generator function,
instead it returns a called generator so that validation can be
synchronous and not wait for the first iteration

Fixes: https://github.com/nodejs/node/issues/41648

PR-URL: https://github.com/nodejs/node/pull/41652
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2022-01-27 16:53:00 +00:00
Benjamin Gruenbaum
830007dafd stream: add asIndexedPairs
Add the asIndexedPairs method for readable streams.

PR-URL: https://github.com/nodejs/node/pull/41681
Refs: https://github.com/tc39/proposal-iterator-helpers#asindexedpairs
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-27 13:04:49 +02:00
Benjamin Gruenbaum
a8afe26fca stream: add drop and take
This adds the `drop` and `take` methods to readable streams allowing
users easily drop and take items from the stream.

This continues the iterator-helper proposal alignment task.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41630
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-23 18:43:16 +02:00
Benjamin Gruenbaum
ca489497be
stream: never flatten on toArray
PR-URL: https://github.com/nodejs/node/pull/41615
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-23 08:19:53 +00:00
Benjamin Gruenbaum
cc8931a916 stream: support flatMap
Support the `flatMap` method from the iterator helper TC39 proposal on
readable streams.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41612
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-23 10:13:17 +02:00
Rich Trott
e6fdcbe534 stream: check for null instead of falsy in loops
Check for null in while loops. This is preparing the code for
the no-cond-assign ESLint rule.

PR-URL: https://github.com/nodejs/node/pull/41614
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-01-22 19:38:06 -08:00
Benjamin Gruenbaum
5badf46f2a stream: support some and every
This continues on the iterator-helpers work by adding `.some` and
`.every` to readable streams.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41573
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-21 12:10:17 +02:00
Benjamin Gruenbaum
5a407d606a stream: add toArray
Add the toArray method from the TC39 iterator helper proposal to
Readable streams. This also enables a common-use case of converting a
stream to an array.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41553
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-20 11:24:29 +02:00
Benjamin Gruenbaum
3f0bcfb203 stream: add forEach method
Add a `forEach` method to readable streams to enable concurrent
iteration and align with the iterator-helpers proposal.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41445
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2022-01-17 14:25:04 +02:00
Rich Trott
20347d5154
stream: avoid function call where possible
Instead of assigning a boolean, move the function call that assigns a
value to the boolean to the only place that boolean is checked. This
avoids the function call in cases where it is not needed.

Refs: https://github.com/nodejs/node/pull/41488#pullrequestreview-850626528

PR-URL: https://github.com/nodejs/node/pull/41534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-17 05:31:30 +00:00
Rich Trott
f7be6ab042
stream: remove always-false condition check
Remove comparison to null of variable guaranteed to be a boolean.

PR-URL: https://github.com/nodejs/node/pull/41488
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-01-15 00:07:46 +00:00
Rich Trott
8c3637cd35
stream: fix error-path function call
The `onFinish()` function takes a single argument. The two extra
arguments passed here are already in the function scope, and may result
in the error being mishandled.

PR-URL: https://github.com/nodejs/node/pull/41433
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2022-01-11 02:53:21 +00:00
Robert Nagy
48e784043d stream: don't emit finish after destroy
PR-URL: https://github.com/nodejs/node/pull/40852
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-03 16:32:44 +01:00
Benjamin Gruenbaum
55c5120b07 stream: add filter method to readable
This continues the work in https://github.com/nodejs/node/pull/40815 to
make streams compatible with upcoming ECMAScript language features. It
adds an experimental `filter` api to streams and tests/docs for it.

See https://github.com/tc39/proposal-iterator-helpers/

Co-Authored-By: Robert Nagy <ronagy@icloud.com>

PR-URL: https://github.com/nodejs/node/pull/41354
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-02 09:52:50 +02:00
Robert Nagy
a698c49993 stream: add isReadable helper
PR-URL: https://github.com/nodejs/node/pull/41199
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-29 20:42:10 +01:00
Benjamin Gruenbaum
b97b81d4ec stream: add map method to Readable
Implement the map method on readable stream. This starts the alignment
with the tc39-iterator-helpers proposal and adds a `.map` method to
every Node.js readable stream.

Co-Authored-By: Robert Nagy <ronag@icloud.com>

PR-URL: https://github.com/nodejs/node/pull/40815
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-29 20:32:36 +01:00
Robert Nagy
752d75d8bc stream: add isErrored helper
Refs: https://github.com/nodejs/undici/pull/1134

PR-URL: https://github.com/nodejs/node/pull/41121
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-12-16 14:28:31 +01:00
Robert Nagy
1fa507f098 stream: allow readable to end early without error
PR-URL: https://github.com/nodejs/node/pull/40881
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-06 20:42:12 +01:00
James M Snell
af28b0d540
stream: use cause options in AbortError constructors
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/41008
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-12-02 12:14:10 -08:00
Robert Nagy
40a52bde95
stream: cleanup eos
PR-URL: https://github.com/nodejs/node/pull/40998
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-12-01 01:50:24 +00:00
Robert Nagy
37f1dd9ccd stream: drain Transform with 0 highWaterMark
Fixes: https://github.com/nodejs/node/issues/40935

PR-URL: https://github.com/nodejs/node/pull/40947
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-11-27 18:09:41 +01:00
Robert Nagy
49b8c4f08b
stream: stricter isReadableNodeStream
Fixes: https://github.com/nodejs/node/issues/40938

PR-URL: https://github.com/nodejs/node/pull/40941
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-26 17:33:05 +00:00
Robert Nagy
8ee4e672ec stream: pipeline with end option
Currently pipeline cannot fully replace pipe due
to the missing end option. This PR adds the end
option to the promisified pipeline method.

PR-URL: https://github.com/nodejs/node/pull/40886
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-22 10:52:23 +01:00
Matteo Collina
cb75dec299
stream: fix finished regression when working with legacy Stream
Signed-off-by: Matteo Collina <hello@matteocollina.com>

PR-URL: https://github.com/nodejs/node/pull/40858
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-11-22 09:32:02 +00:00
Robert Nagy
340b770d3f stream: unify writableErrored and readableErrored
Both of these should always refer to the same error, hence
there is no reason to separate them.

PR-URL: https://github.com/nodejs/node/pull/40799
Refs: https://github.com/nodejs/node/pull/40696
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-18 14:31:43 +01:00
Robert Nagy
0a3a60130c stream: pipeline should drain empty readable
This simplifies some cases where the last stream is a Duplex
without any expected output.

await pipeline(readable, duplex)

PR-URL: https://github.com/nodejs/node/pull/40654
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-11-18 11:02:00 +01:00