1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

LibJS: Make string_to_number() return double instead of Optional<Value>

This would never return an empty optional or non-numeric value, and in
fact every caller as_double()'d the value right away.
Let's make the type match reality instead :^)
This commit is contained in:
Linus Groh 2023-03-01 14:48:12 +00:00
parent 9fb7f7fceb
commit e77503e49b
3 changed files with 14 additions and 14 deletions

View file

@ -563,7 +563,7 @@ enum class NumberToStringMode {
};
ErrorOr<String> number_to_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
DeprecatedString number_to_deprecated_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
Optional<Value> string_to_number(StringView);
double string_to_number(StringView);
inline bool Value::operator==(Value const& value) const { return same_value(*this, value); }