undefined close();
(ctx: Ctx<'js>, controller: This<OwnedBorrowMut<'js, Self>>)
| 1682 | // undefined close(); |
| 1683 | fn close(ctx: Ctx<'js>, controller: This<OwnedBorrowMut<'js, Self>>) -> Result<()> { |
| 1684 | // If this.[[closeRequested]] is true, throw a TypeError exception. |
| 1685 | if controller.close_requested { |
| 1686 | return Err(Exception::throw_type(&ctx, "close() called more than once")); |
| 1687 | } |
| 1688 | |
| 1689 | let objects = ReadableStreamObjects::from_byte_controller(controller.0).refresh_reader(); |
| 1690 | |
| 1691 | if !matches!(objects.stream.state, ReadableStreamState::Readable) { |
| 1692 | return Err(Exception::throw_type( |
| 1693 | &ctx, |
| 1694 | "close() called when stream is not readable", |
| 1695 | )); |
| 1696 | }; |
| 1697 | |
| 1698 | // Perform ? ReadableByteStreamControllerClose(this). |
| 1699 | Self::readable_byte_stream_controller_close(ctx, objects)?; |
| 1700 | Ok(()) |
| 1701 | } |
| 1702 | |
| 1703 | // undefined enqueue(ArrayBufferView chunk); |
| 1704 | fn enqueue( |
| 1705 | this: This<OwnedBorrowMut<'js, Self>>, |
nothing calls this directly
no test coverage detected