stream: fix nested compose error propagation#62556
Open
mcollina wants to merge 2 commits intonodejs:mainfrom
Open
stream: fix nested compose error propagation#62556mcollina wants to merge 2 commits intonodejs:mainfrom
mcollina wants to merge 2 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
ronag
approved these changes
Apr 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62556 +/- ##
==========================================
- Coverage 91.53% 89.76% -1.78%
==========================================
Files 352 696 +344
Lines 147833 214833 +67000
Branches 23148 41107 +17959
==========================================
+ Hits 135321 192840 +57519
- Misses 12255 14103 +1848
- Partials 257 7890 +7633
🚀 New features to boost your workflow:
|
aduh95
reviewed
Apr 2, 2026
Comment on lines
+128
to
+130
| for await (const chunk of source) { | ||
| yield chunk; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| for await (const chunk of source) { | |
| yield chunk; | |
| } | |
| yield* source; |
aduh95
reviewed
Apr 2, 2026
| const stream = Readable.from(['hello']) | ||
| .compose(async function *(source) { | ||
| for await (const chunk of source) { | ||
| throw new Error(`boom: ${chunk}`); |
Contributor
There was a problem hiding this comment.
To fix the linter error
Suggested change
| throw new Error(`boom: ${chunk}`); | |
| yield chunk; | |
| throw new Error(`boom: ${chunk}`); |
aduh95
reviewed
Apr 2, 2026
lib/internal/streams/duplexify.js
Outdated
| if (resolve !== null) { | ||
| const _resolve = resolve; | ||
| resolve = null; | ||
| _resolve({ done: true, cb() {} }); |
Contributor
There was a problem hiding this comment.
Suggested change
| _resolve({ done: true, cb() {} }); | |
| _resolve({ __proto__: null, done: true, cb() {} }); |
32916e9 to
608b639
Compare
mcollina
added a commit
to mcollina/node
that referenced
this pull request
Apr 6, 2026
Add eslint-disable-line require-yield for generator that intentionally doesn't yield (throws error instead). Add __proto__: null in duplexify.js object literal as suggested by reviewer.
benjamingr
approved these changes
Apr 6, 2026
Add eslint-disable-line require-yield for generator that intentionally doesn't yield (throws error instead). Add __proto__: null in duplexify.js object literal as suggested by reviewer. Use yield* source instead of for-await loop in second transform.
8c64fb7 to
8f4657c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #60083