LibJS: Throw RangeError in PrepareTemporalFields for +/-∞

This is a normative change in the Temporal spec.

See: 499282a
This commit is contained in:
Linus Groh 2021-09-01 00:25:17 +01:00
commit ed98c1afc7
Notes: sideshowbarker 2024-07-18 04:56:53 +09:00
5 changed files with 25 additions and 32 deletions

View file

@ -351,8 +351,8 @@ Optional<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject& global_o
return {};
}
// d. Set value to ? ToIntegerOrInfinity(value).
auto value_number = value.to_integer_or_infinity(global_object);
// d. Set value to ? ToIntegerThrowOnInfinity(value).
auto value_number = to_integer_throw_on_infinity(global_object, value, ErrorType::TemporalPropertyMustBeFinite);
if (vm.exception())
return {};