Script: implement ReadableStreamBYOBRequest (#35074)

* Script: implement ReadableStreamBYOBReader::Read

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* implement viewed_buffer_array_byte_length and byte_length

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Correct BufferSource implemntation

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Reduce BufferSource to two variants ArrayBuffer and ArrayBufferView

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Scriptt: implement ReadableStreamBYOBRequest

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix is_detached_buffer and viewed_buffer_array_byte_length

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Use if let Some instead of unwrap()

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2025-02-04 12:58:46 +01:00 committed by GitHub
parent c0cef69108
commit 6547d35fa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 68 additions and 11 deletions

View file

@ -39,6 +39,19 @@ impl ReadableByteStreamController {
) {
todo!()
}
/// <https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond>
pub(crate) fn respond(&self, _bytes_written: u64) -> Fallible<()> {
todo!()
}
/// <https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-with-new-view>
pub(crate) fn respond_with_new_view(
&self,
_view: HeapBufferSource<ArrayBufferViewU8>,
) -> Fallible<()> {
todo!()
}
}
impl ReadableByteStreamControllerMethods<crate::DomTypeHolder> for ReadableByteStreamController {