mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
AK+Everywhere: Store JSON object keys as String
This commit is contained in:
parent
70eb0ba1cd
commit
e591636419
Notes:
github-actions[bot]
2025-02-21 00:29:28 +00:00
Author: https://github.com/trflynn89
Commit: e591636419
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3631
Reviewed-by: https://github.com/awesomekling ✅
23 changed files with 119 additions and 111 deletions
|
@ -93,7 +93,7 @@ void WalkerActor::handle_message(StringView type, JsonObject const& message)
|
|||
send_message(move(response));
|
||||
|
||||
JsonObject message;
|
||||
message.set("from", name());
|
||||
message.set("from"sv, name());
|
||||
send_message(move(message));
|
||||
|
||||
return;
|
||||
|
@ -175,12 +175,12 @@ JsonValue WalkerActor::serialize_node(JsonObject const& node) const
|
|||
JsonArray attrs;
|
||||
|
||||
if (auto attributes = node.get_object("attributes"sv); attributes.has_value()) {
|
||||
attributes->for_each_member([&](ByteString const& name, JsonValue const& value) {
|
||||
attributes->for_each_member([&](String const& name, JsonValue const& value) {
|
||||
if (!value.is_string())
|
||||
return;
|
||||
|
||||
JsonObject attr;
|
||||
attr.set("name"sv, name);
|
||||
attr.set("name"sv, name.to_byte_string());
|
||||
attr.set("value"sv, value.as_string());
|
||||
attrs.must_append(move(attr));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue