mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-25 06:45:28 +00:00
`get()` is intended as a replacement for `get_deprecated()` and `get_ptr ()`. The former returns the same value for "key not found" and "key found and contains `null`" which is ambiguous. The latter returns a raw pointer which is spooky. Returning `Optional<JsonValue const&>` covers all the previous uses for these. The `get_foo()` methods are helpers to make user code less verbose. Most of the time, we only want a specific type of value: if we want a number and get a string, we respond the same as if the value was not there at all. These make that easier to express. This also adjusts the `has_i32()` method and friends to examine the value instead of just looking at the underlying type.
6.1 KiB
6.1 KiB