mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Support [de]serialization for {Map, Set, Object, Array} objects
This commit is contained in:
parent
4e89ec7fd5
commit
20734ac335
Notes:
sideshowbarker
2024-07-16 22:17:03 +09:00
Author: https://github.com/IdanHo
Commit: 20734ac335
Pull-request: https://github.com/SerenityOS/serenity/pull/21895
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