File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
reference-implementation/lib Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -1012,8 +1012,7 @@ default-reader-asynciterator-prototype-internal-slots">Asynchronous iteration</h
1012
1012
ignore> stream</var> and |iterator|, are:
1013
1013
1014
1014
1. Let |reader| be |iterator|'s [=ReadableStream async iterator/reader=] .
1015
- 1. If |reader|.[=ReadableStreamGenericReader/[[stream]]=] is undefined, return [=a promise rejected
1016
- with=] a {{TypeError}} .
1015
+ 1. Assert: |reader|.[=ReadableStreamGenericReader/[[stream]]=] is not undefined.
1017
1016
1. Let |promise| be [=a new promise=] .
1018
1017
1. Let |readRequest| be a new [=read request=] with the following [=struct/items=] :
1019
1018
: [=read request/chunk steps=] , given |chunk|
@@ -1036,8 +1035,7 @@ default-reader-asynciterator-prototype-internal-slots">Asynchronous iteration</h
1036
1035
ignore> stream</var> , |iterator|, and |arg|, are:
1037
1036
1038
1037
1. Let |reader| be |iterator|'s [=ReadableStream async iterator/reader=] .
1039
- 1. If |reader|.[=ReadableStreamGenericReader/[[stream]]=] is undefined, return [=a promise resolved
1040
- with=] undefined.
1038
+ 1. Assert: |reader|.[=ReadableStreamGenericReader/[[stream]]=] is not undefined.
1041
1039
1. Assert: |reader|.[=ReadableStreamDefaultReader/[[readRequests]]=] is [=list/is empty|empty=] ,
1042
1040
as the async iterator machinery guarantees that any previous calls to `next()` have settled
1043
1041
before this is called.
Original file line number Diff line number Diff line change @@ -119,11 +119,7 @@ exports.implementation = class ReadableStreamImpl {
119
119
120
120
[ idlUtils . asyncIteratorNext ] ( iterator ) {
121
121
const reader = iterator . _reader ;
122
- if ( reader . _stream === undefined ) {
123
- return promiseRejectedWith (
124
- new TypeError ( 'Cannot get the next iteration result once the reader has been released' )
125
- ) ;
126
- }
122
+ assert ( reader . _stream !== undefined ) ;
127
123
128
124
const promise = newPromise ( ) ;
129
125
const readRequest = {
@@ -143,10 +139,7 @@ exports.implementation = class ReadableStreamImpl {
143
139
144
140
[ idlUtils . asyncIteratorReturn ] ( iterator , arg ) {
145
141
const reader = iterator . _reader ;
146
- if ( reader . _stream === undefined ) {
147
- return promiseResolvedWith ( undefined ) ;
148
- }
149
-
142
+ assert ( reader . _stream !== undefined ) ;
150
143
assert ( reader . _readRequests . length === 0 ) ;
151
144
152
145
if ( iterator . _preventCancel === false ) {
You can’t perform that action at this time.
0 commit comments