www/lib/web-streams-polyfill/dist/ponyfill.js
// A client of ReadableByteStreamController may use these functions directly to bypass state check.
A client of ReadableByteStreamController may use these functions directly to bypass state check.
A client of ReadableByteStreamController may use these functions directly to bypass state check .
function ReadableByteStreamControllerClose(controller) {
        var stream = controller._controlledReadableByteStream;
        if (controller._queueTotalSize > 0) {
            controller._closeRequested = true;
            return;
        }
        if (controller._pendingPullIntos.length > 0) {
            var firstPendingPullInto = controller._pendingPullIntos.peek();
            if (firstPendingPullInto.bytesFilled > 0) {
                var e = new TypeError('Insufficient bytes to fill elements in the given buffer');
                ReadableByteStreamControllerError(controller, e);
                throw e;
            }
        }
        ReadableByteStreamControllerClearAlgorithms(controller);
        ReadableStreamClose(stream);
    }
function ReadableByteStreamControllerClose ( controller ) { var stream = controller . _controlledReadableByteStream ; if ( controller . _queueTotalSize > 0 ) { controller . _closeRequested = true ; return ; } if ( controller . _pendingPullIntos . length > 0 ) { var firstPendingPullInto = controller . _pendingPullIntos . peek ( ) ; if ( firstPendingPullInto . bytesFilled > 0 ) { var e = new TypeError ( 'Insufficient bytes to fill elements in the given buffer' ) ; ReadableByteStreamControllerError ( controller , e ) ; throw e ; } } ReadableByteStreamControllerClearAlgorithms ( controller ) ; ReadableStreamClose ( stream ) ; }
A client of ReadableByteStreamController may use these functions directly to bypass state check.
A client of ReadableByteStreamController may use these functions directly to bypass state check .