@@ -529,7 +529,7 @@ function WritableStreamDefaultWriterWrite(writer, chunk) {
529
529
// Default controllers
530
530
531
531
function SetUpWritableStreamDefaultController ( stream , controller , startAlgorithm , writeAlgorithm , closeAlgorithm ,
532
- abortAlgorithm , highWaterMark , sizeAlgorithm ) {
532
+ abortAlgorithm , highWaterMark , sizeAlgorithm , isOwning ) {
533
533
assert ( WritableStream . isImpl ( stream ) ) ;
534
534
assert ( stream . _controller === undefined ) ;
535
535
@@ -551,6 +551,8 @@ function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm
551
551
controller . _closeAlgorithm = closeAlgorithm ;
552
552
controller . _abortAlgorithm = abortAlgorithm ;
553
553
554
+ controller . _isOwning = isOwning ;
555
+
554
556
const backpressure = WritableStreamDefaultControllerGetBackpressure ( controller ) ;
555
557
WritableStreamUpdateBackpressure ( stream , backpressure ) ;
556
558
@@ -579,6 +581,7 @@ function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyi
579
581
let writeAlgorithm = ( ) => promiseResolvedWith ( undefined ) ;
580
582
let closeAlgorithm = ( ) => promiseResolvedWith ( undefined ) ;
581
583
let abortAlgorithm = ( ) => promiseResolvedWith ( undefined ) ;
584
+ const isOwning = underlyingSinkDict . type === 'owning' ;
582
585
583
586
if ( 'start' in underlyingSinkDict ) {
584
587
startAlgorithm = ( ) => underlyingSinkDict . start . call ( underlyingSink , controller ) ;
@@ -594,8 +597,8 @@ function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyi
594
597
}
595
598
596
599
SetUpWritableStreamDefaultController (
597
- stream , controller , startAlgorithm , writeAlgorithm , closeAlgorithm , abortAlgorithm , highWaterMark , sizeAlgorithm
598
- ) ;
600
+ stream , controller , startAlgorithm , writeAlgorithm , closeAlgorithm , abortAlgorithm , highWaterMark , sizeAlgorithm ,
601
+ isOwning ) ;
599
602
}
600
603
601
604
function WritableStreamDefaultControllerAdvanceQueueIfNeeded ( controller ) {
0 commit comments