File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,13 +162,22 @@ async function testShareAbortSignalWhileSourcePullPending() {
162162 const sourceStartedPromise = new Promise ( ( resolve ) => {
163163 sourceStarted = resolve ;
164164 } ) ;
165- async function * source ( ) {
166- await new Promise ( ( resolve ) => {
167- resume = resolve ;
168- sourceStarted ( ) ;
169- } ) ;
170- }
171- const shared = share ( source ( ) , { signal : ac . signal } ) ;
165+ const source = {
166+ __proto__ : null ,
167+ [ Symbol . asyncIterator ] ( ) {
168+ return {
169+ __proto__ : null ,
170+ async next ( ) {
171+ await new Promise ( ( resolve ) => {
172+ resume = resolve ;
173+ sourceStarted ( ) ;
174+ } ) ;
175+ return { __proto__ : null , done : true , value : undefined } ;
176+ } ,
177+ } ;
178+ } ,
179+ } ;
180+ const shared = share ( source , { signal : ac . signal } ) ;
172181 const iter1 = shared . pull ( ) [ Symbol . asyncIterator ] ( ) ;
173182 const iter2 = shared . pull ( ) [ Symbol . asyncIterator ] ( ) ;
174183 const read1 = iter1 . next ( ) ;
You can’t perform that action at this time.
0 commit comments