Skip to content

Commit

Permalink
stream: improve inspector ergonomics
Browse files Browse the repository at this point in the history
PR-URL: #53800
Fixes: #53789
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
  • Loading branch information
benjamingr authored and marco-ippolito committed Aug 19, 2024
1 parent 2f66c7e commit 56299f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2034,8 +2034,8 @@ function readableStreamError(stream, error) {
assert(stream[kState].state === 'readable');
stream[kState].state = 'errored';
stream[kState].storedError = error;
stream[kIsClosedPromise].reject(error);
setPromiseHandled(stream[kIsClosedPromise].promise);
stream[kIsClosedPromise].reject(error);

const {
reader,
Expand All @@ -2044,8 +2044,8 @@ function readableStreamError(stream, error) {
if (reader === undefined)
return;

reader[kState].close.reject(error);
setPromiseHandled(reader[kState].close.promise);
reader[kState].close.reject(error);

if (readableStreamHasDefaultReader(stream)) {
for (let n = 0; n < reader[kState].readRequests.length; n++)
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,15 +761,15 @@ function writableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {
};
}

stream[kIsClosedPromise].reject(stream[kState]?.storedError);
setPromiseHandled(stream[kIsClosedPromise].promise);
stream[kIsClosedPromise].reject(stream[kState]?.storedError);

const {
writer,
} = stream[kState];
if (writer !== undefined) {
writer[kState].close.reject?.(stream[kState].storedError);
setPromiseHandled(writer[kState].close.promise);
writer[kState].close.reject?.(stream[kState].storedError);
}
}

Expand Down

0 comments on commit 56299f7

Please sign in to comment.