1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

LibJS: Make JS::number_to_string() infallible

Work towards #20449.
This commit is contained in:
Andreas Kling 2023-08-09 08:03:12 +02:00
parent 09547ec975
commit b8f78c0adc
9 changed files with 66 additions and 68 deletions

View file

@ -144,7 +144,7 @@ ThrowCompletionOr<Optional<Value>> PrimitiveString::get(VM& vm, PropertyKey cons
return Value(static_cast<double>(length));
}
}
auto index = MUST_OR_THROW_OOM(canonical_numeric_index_string(vm, property_key, CanonicalIndexMode::IgnoreNumericRoundtrip));
auto index = canonical_numeric_index_string(property_key, CanonicalIndexMode::IgnoreNumericRoundtrip);
if (!index.is_index())
return Optional<Value> {};
auto str = utf16_string_view();