diff --git a/src/js/builtins/ReadableStreamInternals.ts b/src/js/builtins/ReadableStreamInternals.ts index 7f95f39ee9b9d7..4159919933e0b7 100644 --- a/src/js/builtins/ReadableStreamInternals.ts +++ b/src/js/builtins/ReadableStreamInternals.ts @@ -1101,15 +1101,8 @@ export function onFlushDirectStream() { } var _pendingRead = this._pendingRead; - this._pendingRead = undefined; if (_pendingRead && $isPromise(_pendingRead)) { - var flushed = this.$sink.flush(); - if (flushed?.byteLength) { - this._pendingRead = $getByIdDirectPrivate(stream, "readRequests")?.shift(); - $fulfillPromise(_pendingRead, { value: flushed, done: false }); - } else { - this._pendingRead = _pendingRead; - } + this.$sink.flush(); } else if ($getByIdDirectPrivate(stream, "readRequests")?.isNotEmpty()) { var flushed = this.$sink.flush(); if (flushed?.byteLength) {