mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:08:13 +00:00
LibWeb: Support [de]serialization for {Map, Set, Object, Array} objects
This commit is contained in:
parent
4e89ec7fd5
commit
20734ac335
8 changed files with 447 additions and 190 deletions
|
@ -11,6 +11,15 @@
|
|||
println(structuredClone(/abc/gimsuy));
|
||||
println(structuredClone(new Error()));
|
||||
println(structuredClone(new URIError("hello")));
|
||||
println(structuredClone(JSON.stringify({"a": "b", 1: 2})));
|
||||
println(structuredClone([1, 4, "aaaa"]));
|
||||
println(structuredClone(new Set(["a", "b", "c"])).has("b"));
|
||||
println(structuredClone(new Map([["a", 0], ["b", 1], ["c", 2]])).get("b"));
|
||||
|
||||
const obj = {"a": 1, "c": 3};
|
||||
obj["b"] = obj;
|
||||
const result = structuredClone(obj);
|
||||
println(result === result["b"]);
|
||||
|
||||
{
|
||||
let arrayBuffer = new ArrayBuffer(6);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue