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 89.78% 89.79% +0.01%
==========================================
Files 697 697
Lines 215749 215770 +21
Branches 41294 41298 +4
==========================================
+ Hits 193705 193748 +43
+ Misses 14124 14119 -5
+ Partials 7920 7903 -17
🚀 New features to boost your workflow:
|
aduh95
reviewed
Apr 2, 2026
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}`); |
Member
There was a problem hiding this comment.
I think the point of this is that it does not yield anything. The eslint-disable for require-yield is the correct fix I believe.
aduh95
reviewed
Apr 2, 2026
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
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. Use yield* source instead of for-await loop in second transform.
8c64fb7 to
8f4657c
Compare
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.
8f4657c to
efff997
Compare
Member
Author
|
@benjamingr @aduh95 ptal |
jasnell
approved these changes
Apr 7, 2026
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