1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58:12 +00:00

LibWeb: Add {de}serialization steps for ArrayBuffers

This commit is contained in:
Andrew Kaster 2023-09-11 18:06:43 -06:00 committed by Andreas Kling
parent a527f55768
commit 642802d339
3 changed files with 92 additions and 5 deletions

View file

@ -10,6 +10,21 @@
println(structuredClone(Date.UTC(2023, 7, 23)));
println(structuredClone(/abc/gimsuy));
{
let arrayBuffer = new ArrayBuffer(6);
for (let i = 0; i < arrayBuffer.byteLength; ++i) {
arrayBuffer[i] = i;
}
let arrayClone = structuredClone(arrayBuffer);
for (let i = 0; i < arrayBuffer.byteLength; ++i) {
if (arrayBuffer[i] !== arrayBuffer[i]) {
println("FAILED");
}
}
// FIXME: This should print something like ArrayBuffer { byteLength: 6 }
println(arrayClone);
}
try {
structuredClone(Symbol("foo"));
println("FAILED")