ReadableStreamBYOBRequest.js [plain text]
function initializeReadableStreamBYOBRequest(controller, view)
{
"use strict";
if (arguments.length !== 3 && arguments[2] !== @isReadableStream)
@throwTypeError("ReadableStreamBYOBRequest constructor should not be called directly");
return @privateInitializeReadableStreamBYOBRequest.@call(this, controller, view);
}
function respond(bytesWritten)
{
"use strict";
if (!@isReadableStreamBYOBRequest(this))
throw @makeThisTypeError("ReadableStreamBYOBRequest", "respond");
if (@getByIdDirectPrivate(this, "associatedReadableByteStreamController") === @undefined)
@throwTypeError("ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined");
return @readableByteStreamControllerRespond(@getByIdDirectPrivate(this, "associatedReadableByteStreamController"), bytesWritten);
}
function respondWithNewView(view)
{
"use strict";
if (!@isReadableStreamBYOBRequest(this))
throw @makeThisTypeError("ReadableStreamBYOBRequest", "respond");
if (@getByIdDirectPrivate(this, "associatedReadableByteStreamController") === @undefined)
@throwTypeError("ReadableStreamBYOBRequest.associatedReadableByteStreamController is undefined");
if (!@isObject(view))
@throwTypeError("Provided view is not an object");
if (!@ArrayBuffer.@isView(view))
@throwTypeError("Provided view is not an ArrayBufferView");
return @readableByteStreamControllerRespondWithNewView(@getByIdDirectPrivate(this, "associatedReadableByteStreamController"), view);
}
@getter
function view()
{
"use strict";
if (!@isReadableStreamBYOBRequest(this))
throw @makeGetterTypeError("ReadableStreamBYOBRequest", "view");
return @getByIdDirectPrivate(this, "view");
}