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

LibJS: Fix logic error in RegulateISODate

This commit is contained in:
Linus Groh 2021-08-22 23:08:17 +01:00
parent b9ab7a5095
commit 573587b83a

View file

@ -183,7 +183,7 @@ Optional<ISODate> regulate_iso_date(GlobalObject& global_object, double year, do
auto m = static_cast<u8>(month);
auto d = static_cast<u8>(day);
// a. If ! IsValidISODate(year, month, day) is false, throw a RangeError exception.
if (is_valid_iso_date(y, m, d)) {
if (!is_valid_iso_date(y, m, d)) {
vm.throw_exception<RangeError>(global_object, ErrorType::TemporalInvalidPlainDate);
return {};
}