GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: apply more stream/iter fixes, round 3 by jasnell · Pull Request #66079 · nodejs/node

stream: apply more stream/iter fixes, round 3 #66079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jasnell wants to merge 8 commits into nodejs:main from jasnell:jasnell/moar-iter-streams-3

Uh oh!

There was an error while loading. Please reload this page.

Closed

stream: apply more stream/iter fixes, round 3 #66079

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit Hold shift + click to select a range
543436c
stream: make stream/iter toWritable apply backpressure
jasnell Aug 30, 2026
77dafe6
stream: correct strict pending-write behavior & cancellation
jasnell Aug 30, 2026
f578f9c
stream: make classic reads wake on return/throw/abort
jasnell Aug 30, 2026
0e1a293
stream,quic: correct stream/iter writer implementations
jasnell Aug 30, 2026
b02dcf6
doc: fixup and cleanup stream/iter docs
jasnell Aug 30, 2026
f3910f2
stream: cleanup promise uses in stream/iter
jasnell Aug 30, 2026
0b2fffe
test: avoid using promise wrapped timers
jasnell Aug 30, 2026
71c2c02
stream: fill out stream/iter test coverage
jasnell Sep 22, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
stream: cleanup promise uses in stream/iter
Signed-off-by: James M Snell <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell committed Sep 22, 2026
commit f3910f289af14601bf957d9eefb33c6957fa184d

There are no files selected for viewing

7 changes: 6 additions & 1 deletion 7 lib/internal/streams/iter/broadcast.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const {
abortSignal,
} = require('internal/abort_controller');

const { markPromiseAsHandled } = internalBinding('util');

const {
codes: {
ERR_INVALID_ARG_TYPE,
Expand Down Expand Up @@ -989,7 +991,10 @@ const Broadcast = {
}
}
};
PromisePrototypeThen(pump(), undefined, () => {});

const pumpPromise = PromisePrototypeThen(
pump(), undefined, undefined);
markPromiseAsHandled(pumpPromise);

return result;
},
Expand Down
6 changes: 5 additions & 1 deletion 6 lib/internal/streams/iter/pull.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const {
kValidatedTransform,
} = require('internal/streams/iter/types');

const { markPromiseAsHandled } = internalBinding('util');

// =============================================================================
// Type Guards and Helpers
// =============================================================================
Expand Down Expand Up @@ -905,7 +907,9 @@ function pullWithConsumerCleanup(source, transforms, signal) {
const close = sourceIterator[method] ?? sourceIterator.return;
if (typeof close === 'function') {
const result = FunctionPrototypeCall(close, sourceIterator, value);
PromisePrototypeThen(PromiseResolve(result), undefined, () => {});
const cleanup = PromisePrototypeThen(
PromiseResolve(result), undefined, undefined);
markPromiseAsHandled(cleanup);
}
}

Expand Down
11 changes: 7 additions & 4 deletions 11 lib/internal/streams/iter/share.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const {
validateInteger,
} = require('internal/validators');

const { markPromiseAsHandled } = internalBinding('util');

// =============================================================================
// Async Share Implementation
// =============================================================================
Expand Down Expand Up @@ -240,8 +242,8 @@ class ShareImpl {
state.pendingNext,
getNext,
getNext);
state.pendingNext =
PromisePrototypeThen(next, undefined, () => {});
state.pendingNext = next;
markPromiseAsHandled(state.pendingNext);
return next;
},

Expand Down Expand Up @@ -284,11 +286,12 @@ class ShareImpl {
try {
const returnMethod = this.#sourceIterator?.return;
if (typeof returnMethod === 'function') {
PromisePrototypeThen(
const cleanup = PromisePrototypeThen(
PromiseResolve(FunctionPrototypeCall(
returnMethod, this.#sourceIterator)),
undefined,
() => {});
undefined);
markPromiseAsHandled(cleanup);
}
} catch {
// Cancellation has precedence over source cleanup errors.
Expand Down
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.