1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 20:32:12 +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

@ -63,7 +63,7 @@ static ThrowCompletionOr<Optional<PropertyDescriptor>> string_get_own_property(S
return Optional<PropertyDescriptor> {};
// 2. Let index be CanonicalNumericIndexString(P).
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);
// 3. If index is undefined, return undefined.
// 4. If IsIntegralNumber(index) is false, return undefined.