1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00:00
serenity/Tests/LibWeb/Text/input/Streams/ReadableStream-autoAllocateChunkSize-constructor.html
Shannon Booth 6b88fc2e05 LibWeb: Properly convert UnderlyingSource's autoAllocateChunkSize to u64
The JS::Value being passed through is not a bigint, and needs to be
converted using ConvertToInt, as per:

https://webidl.spec.whatwg.org/#es-unsigned-long-long

Furthermore, the IDL definition also specifies that this is associated
with the [EnforceRange] extended attribute.

This makes it actually possible to pass through an autoAllocateChunkSize
to the ReadableStream constructor without it throwing a TypeError.
2024-01-02 10:01:26 +01:00

10 lines
260 B
HTML

<script src="../include.js"></script>
<script>
test(() => {
let stream = new ReadableStream({
type: "bytes",
autoAllocateChunkSize: 64
});
println(`PASS. Made: ${stream.constructor.name}`);
});
</script>