Skip to content

Commit 91bb2eb

Browse files
streams: update ongoing promise in async iterator return() method
1 parent 231548b commit 91bb2eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/webstreams/readablestream.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,14 @@ class ReadableStream {
545545
},
546546

547547
return(error) {
548-
return state.current ?
548+
started = true;
549+
state.current = state.current !== undefined ?
549550
PromisePrototypeThen(
550551
state.current,
551552
() => returnSteps(error),
552553
() => returnSteps(error)) :
553554
returnSteps(error);
555+
return state.current;
554556
},
555557

556558
[SymbolAsyncIterator]() { return this; },

0 commit comments

Comments
 (0)