Skip to content

Commit

Permalink
streams: update ongoing promise in async iterator return() method
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Apr 23, 2024
1 parent 231548b commit 91bb2eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,14 @@ class ReadableStream {
},

return(error) {
return state.current ?
started = true;
state.current = state.current !== undefined ?
PromisePrototypeThen(
state.current,
() => returnSteps(error),
() => returnSteps(error)) :
returnSteps(error);
return state.current;
},

[SymbolAsyncIterator]() { return this; },
Expand Down

0 comments on commit 91bb2eb

Please sign in to comment.