1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibJS: Use nsMinInstant / nsMaxInstant constants in ParseTemporalInstant

This is an editorial change in the Temporal spec.

See: a045682
This commit is contained in:
Linus Groh 2022-06-14 23:42:53 +01:00
parent 690585323d
commit 287dd03e2e

View file

@ -118,7 +118,7 @@ ThrowCompletionOr<BigInt*> parse_temporal_instant(GlobalObject& global_object, S
// 5. Let utc be GetEpochFromISOParts(result.[[Year]], result.[[Month]], result.[[Day]], result.[[Hour]], result.[[Minute]], result.[[Second]], result.[[Millisecond]], result.[[Microsecond]], result.[[Nanosecond]]).
auto* utc = get_epoch_from_iso_parts(global_object, result.year, result.month, result.day, result.hour, result.minute, result.second, result.millisecond, result.microsecond, result.nanosecond);
// 6. If (utc) < -8.64 × 10^21 or (utc) > 8.64 × 10^21, then
// 6. If (utc) < nsMinInstant or (utc) > nsMaxInstant, then
if (utc->big_integer() < ns_min_instant || utc->big_integer() > ns_max_instant) {
// a. Throw a RangeError exception.
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidEpochNanoseconds);