Commit graph

9 commits

Author SHA1 Message Date
Andreas Kling
72c9f56c66 LibJS: Make Heap::allocate<T>() infallible
Stop worrying about tiny OOMs. Work towards #20449.

While going through these, I also changed the function signature in many
places where returning ThrowCompletionOr<T> is no longer necessary.
2023-08-13 15:38:42 +02:00
Andreas Kling
c084269e5f LibJS: Make PrimitiveString::utf8_string() infallible
Work towards #20449.
2023-08-09 17:09:16 +02:00
Kenneth Myhra
cf2c2cb4d7 LibWeb: Make sure we fallback to "Unsupported type" if type unrecognized
If we do not recognize the Type being serialized make sure we always
fallback to setting m_error to "Unsupported type".
2023-08-02 14:52:37 +02:00
Kenneth Myhra
7da055e3e1 LibWeb: Remove unused headers in StructuredSerialize.cpp 2023-07-31 10:41:38 +02:00
Kenneth Myhra
9a007ccdbe LibWeb: Serialize strings into a more storage efficient format
This patch changes the way StructuredSerializeInternal() serialize
strings by storing four bytes into a 32-bit entry, instead of one code
point per 32-bit entry.

StructuredDeserialize() has also been changed to deserialize strings by
the same ruleset.
2023-07-31 10:41:38 +02:00
Kenneth Myhra
77e339022b LibWeb: Serialize and deserialize standard built-in objects
This adds support for serializing and deserializing standard built-in
objects:
- Boolean object
- Number object
- String object
- Date object
2023-07-29 17:24:39 +02:00
Kenneth Myhra
8c88e8f896 LibWeb: Add primitive support to Structured{Serialize,Deserialize}
This adds support for Undefined, Null, Boolean, BigInt, and String to
AOs StructuredSerializeInternal and StructuredDeserialize.
2023-07-23 06:37:14 +02:00
Ali Mohammad Pur
06c6c40df9 LibWeb+LibJS: Move some code around to make CSS/Parser parse faster
This makes it possible to include fewer full definitions of things,
which makes the file about 30% faster to compile.
2023-07-11 09:38:37 +03:30
Daniel Ehrenberg
09841f56ed LibWeb: Add initial implementation of structured clone
This implementation only works for cloning Numbers, and does not try to
do all the spec steps for structured serialize and deserialize.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2022-11-26 00:47:23 +01:00