mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 15:34:58 +00:00

Just creating a stream on the JS heap isn't enough, as we will later crash when trying to read from that stream as it hasn't been properly initialized. Instead, until we have teeing implemented (which is a rather huge part of the Streams spec), create streams using proper AOs that do initialize the stream.
17 lines
532 B
HTML
17 lines
532 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(async done => {
|
|
fetch("./../basic.html", { mode: "no-cors" })
|
|
.then(response => {
|
|
const clonedResponse = response.clone();
|
|
return clonedResponse.body;
|
|
})
|
|
.then(body => {
|
|
const reader = body.getReader();
|
|
reader.read();
|
|
|
|
println("Was able to create a reader from a cloned Fetch response!");
|
|
done();
|
|
});
|
|
});
|
|
</script>
|