mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
Everywhere: Add deprecated_ prefix to JsonValue::to_byte_string
`JsonValue::to_byte_string` has peculiar type-erasure semantics which is not usually intended. Unfortunately, it also has a very stereotypical name which does not warn about unexpected behavior. So let's prefix it with `deprecated_` to make new code use `as_string` if it just wants to get string value or `serialized<StringBuilder>` if it needs to do proper serialization.
This commit is contained in:
committed by
Andrew Kaster
parent
4ed5287792
commit
ccd701809f
Notes:
sideshowbarker
2024-07-17 08:27:05 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/ccd701809f Pull-request: https://github.com/SerenityOS/serenity/pull/22631 Reviewed-by: https://github.com/ADKaster
@@ -439,7 +439,7 @@ Value JSONObject::parse_json_value(VM& vm, JsonValue const& value)
|
||||
if (value.is_number())
|
||||
return Value(value.to_double(0));
|
||||
if (value.is_string())
|
||||
return PrimitiveString::create(vm, value.to_byte_string());
|
||||
return PrimitiveString::create(vm, value.as_string());
|
||||
if (value.is_bool())
|
||||
return Value(static_cast<bool>(value.as_bool()));
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
Reference in New Issue
Block a user