2025-03-18 19:28:35 +01:00
|
|
|
<!DOCTYPE html>
|
2024-08-20 20:02:35 +02:00
|
|
|
<script src="../include.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
test(() => {
|
|
|
|
|
const ts = new TransformStream();
|
|
|
|
|
ts.readable.cancel(new Error("error1"));
|
|
|
|
|
ts.writable.getWriter().closed.catch(e => {
|
|
|
|
|
println(`catch ${e}`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const tsWithBackpressure = new TransformStream({}, undefined, { highWaterMark: 0 });
|
|
|
|
|
tsWithBackpressure.readable.cancel(new Error("error1"))
|
|
|
|
|
tsWithBackpressure.writable.getWriter().closed.catch(e => {
|
|
|
|
|
println(`catch ${e}`)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const tsWithoutBackpressure = new TransformStream({}, undefined, { highWaterMark: 1 });
|
|
|
|
|
tsWithoutBackpressure.readable.cancel(new Error("error1"))
|
|
|
|
|
tsWithoutBackpressure.writable.getWriter().closed.catch(e => {
|
|
|
|
|
println(`catch ${e}`)
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
</script>
|