mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
AK: Allow JsonValue to store 64-bit integers internally
Add dedicated internal types for Int64 and UnsignedInt64. This makes it a bit more straightforward to work with 64-bit numbers (instead of just implicitly storing them as doubles.)
This commit is contained in:
@@ -34,10 +34,8 @@ GVariant GJsonArrayModel::data(const GModelIndex& index, Role role) const
|
||||
auto data = object.get(json_field_name);
|
||||
if (field_spec.massage_for_display)
|
||||
return field_spec.massage_for_display(object);
|
||||
if (data.is_int())
|
||||
return data.as_int();
|
||||
if (data.is_uint())
|
||||
return data.as_uint();
|
||||
if (data.is_number())
|
||||
return data.to_i32();
|
||||
return object.get(json_field_name).to_string();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user