File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,11 @@ class Blob {
360360 queueMicrotask ( ( ) => {
361361 if ( c . desiredSize <= 0 ) {
362362 // A manual backpressure check.
363+ if ( this . pendingPulls . length !== 0 ) {
364+ // A case of waiting pull finished (= not yet canceled)
365+ const pending = this . pendingPulls . shift ( ) ;
366+ pending . resolve ( ) ;
367+ }
363368 return ;
364369 }
365370 readNext ( ) ;
Original file line number Diff line number Diff line change @@ -269,6 +269,19 @@ assert.throws(() => new Blob({}), {
269269 reader . closed . then ( common . mustCall ( ) ) ;
270270} ) ( ) . then ( common . mustCall ( ) ) ;
271271
272+ ( async ( ) => {
273+ const b = new Blob ( [ 'A' , 'B' , 'C' ] ) ;
274+ const stream = b . stream ( ) ;
275+ const chunks = [ ] ;
276+ const decoder = new TextDecoder ( ) ;
277+ await stream . pipeTo ( new WritableStream ( {
278+ write ( chunk ) {
279+ chunks . push ( decoder . decode ( chunk , { stream : true } ) ) ;
280+ }
281+ } ) ) ;
282+ assert . strictEqual ( chunks . join ( '' ) , 'ABC' ) ;
283+ } ) ( ) . then ( common . mustCall ( ) ) ;
284+
272285( async ( ) => {
273286 const b = new Blob ( Array ( 10 ) . fill ( 'hello' ) ) ;
274287 const stream = b . stream ( ) ;
You can’t perform that action at this time.
0 commit comments