Skip to content

Commit

Permalink
stream: 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 d7436b4
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 d7436b4

Please sign in to comment.