Commit Graph

20 Commits

Author SHA1 Message Date
Filip Skokan
2aff5cf638 stream: yield expected Error class on zlib errors
PR-URL: https://github.com/nodejs/node/pull/50712
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-11-19 07:36:30 +00:00
Aras Abbasi
83e6350b82
errors: improve hideStackFrames
PR-URL: https://github.com/nodejs/node/pull/49990
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-11-11 16:25:08 +00:00
Antoine du Hamel
fe514bf960
lib: enforce use of trailing commas for functions
PR-URL: https://github.com/nodejs/node/pull/46629
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2023-02-14 18:45:16 +01:00
Deokjin Kim
979ec87665
stream: refactor to use validateFunction
PR-URL: https://github.com/nodejs/node/pull/46007
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-01-01 06:33:41 +00:00
Debadree Chatterjee
2ec418984b
lib: allow Writeable.toWeb() to work on http.Outgoing message
Attempted to fix the issue by watering down the condition being
checked in internal/streams/utils isWritableNodeStream utility

Fixes: https://github.com/nodejs/node/issues/44188
PR-URL: https://github.com/nodejs/node/pull/45642
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-12-10 17:06:40 +00:00
Yagiz Nizipli
ea92ca1484
stream: add primordials to adapters
PR-URL: https://github.com/nodejs/node/pull/45511
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-11-20 23:30:59 +00:00
Kohei Ueno
70305bbe42
stream: fix typo in adapters.js (#45515)
`isReadableNodestream` -> `isReadableNodeStream`

PR-URL: https://github.com/nodejs/node/pull/45515
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-11-19 13:10:44 +01:00
Yagiz Nizipli
770efeab6d
stream: add fast path for utf8
PR-URL: https://github.com/nodejs/node/pull/45483
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2022-11-18 16:03:25 +00:00
David Halls
538d8ce106
stream: don't push null from closed promise #42694
closed promise is subscribed to first so will be
resolved first, before any read promise.

This causes data after EOF error to be thrown.

Remove the push null from the closed promise handler.
The push null gets done from the read handler
when it detects done.

PR-URL: https://github.com/nodejs/node/pull/45026
Fixes: https://github.com/nodejs/node/issues/42694
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-22 17:27:37 +00:00
Antoine du Hamel
ce639629dd
lib: use safe Promise alternatives when available
PR-URL: https://github.com/nodejs/node/pull/43476
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2022-08-27 11:37:01 +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
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
Xuguang Mei
54bc3c9afa
stream: use .chunk when calling adapters's writev
Fix: https://github.com/nodejs/node/issues/42157

PR-URL: https://github.com/nodejs/node/pull/42161
Fixes: https://github.com/nodejs/node/issues/42157
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-03-03 04:53:59 +00:00
Rich Trott
29f714b152 lib,tools: remove empty lines between JSDoc tags
This is in preparation for enabling a recommended JSDoc lint rule.

PR-URL: https://github.com/nodejs/node/pull/41147
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-19 05:30:09 +00:00
Rich Trott
88dd9724b0 lib: include return types in JSDoc
Add types to @returns JSDoc annotations where the type is missing.

PR-URL: https://github.com/nodejs/node/pull/41130
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-12-12 03:51:00 +00: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
3f0b62375b stream: convert premature close to AbortError
AbortError is a more "web" align alternative to
ERR_STREAM_PREMATURE_CLOSE.

PR-URL: https://github.com/nodejs/node/pull/39524
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-28 10:12:04 +02:00
Rich Trott
44ee6c2623 stream: call done() in consistent fashion
All three `destroy()` functions defined in adapter.js contain a `done()`
function that takes no arguments. In one instance, however, an argument
is nonetheless passed. Remove it for consistency.

PR-URL: https://github.com/nodejs/node/pull/39475
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2021-07-22 23:50:13 +00:00
James M Snell
6cd12be347
fs: add FileHandle.prototype.readableWebStream()
Adds an experimental `readableWebStream()` method to `FileHandle` that
returns a web `ReadableStream`

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39331
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-07-15 13:43:20 -07:00
James M Snell
a99c230305
stream: implement streams to webstreams adapters
Experimental adapters for the webstreams API

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/39134
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-07-13 10:03:16 -07:00