1
0
Fork 0
firefox/testing/web-platform/tests/streams/transferable/gc-crash.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

17 lines
571 B
HTML

<!DOCTYPE html>
<html class="test-wait">
<script src="/common/gc.js"></script>
<script type="module">
const b = new ReadableStream({
start(c) {
c.enqueue({}) // the value we will transfer
},
})
const transferred = structuredClone(b, { transfer: [b] })
// Here we request a read, triggering a message transfer
transferred.getReader().read()
// And immediately trigger GC without waiting for the read,
// causing the actual transfer to be done after GC
await garbageCollect()
document.documentElement.classList.remove("test-wait")
</script>