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

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
parent e845e7c814
commit ed98c1afc7
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 {};