mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS: Remove RegulateISODate after BalanceISODate in AddISODate
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/32b22b1
This commit is contained in:
@@ -444,19 +444,16 @@ ThrowCompletionOr<ISODateRecord> add_iso_date(GlobalObject& global_object, i32 y
|
||||
auto intermediate_year_month = balance_iso_year_month(year + years, month + months);
|
||||
|
||||
// 4. Let intermediate be ? RegulateISODate(intermediate.[[Year]], intermediate.[[Month]], day, overflow).
|
||||
auto intermediate_date = TRY(regulate_iso_date(global_object, intermediate_year_month.year, intermediate_year_month.month, day, overflow));
|
||||
auto intermediate = TRY(regulate_iso_date(global_object, intermediate_year_month.year, intermediate_year_month.month, day, overflow));
|
||||
|
||||
// 5. Set days to days + 7 × weeks.
|
||||
days += 7 * weeks;
|
||||
|
||||
// 6. Let d be intermediate.[[Day]] + days.
|
||||
auto d = intermediate_date.day + days;
|
||||
auto d = intermediate.day + days;
|
||||
|
||||
// 7. Let intermediate be BalanceISODate(intermediate.[[Year]], intermediate.[[Month]], d).
|
||||
auto intermediate = balance_iso_date(intermediate_date.year, intermediate_date.month, d);
|
||||
|
||||
// 8. Return ? RegulateISODate(intermediate.[[Year]], intermediate.[[Month]], intermediate.[[Day]], overflow).
|
||||
return regulate_iso_date(global_object, intermediate.year, intermediate.month, intermediate.day, overflow);
|
||||
// 7. Return BalanceISODate(intermediate.[[Year]], intermediate.[[Month]], d).
|
||||
return balance_iso_date(intermediate.year, intermediate.month, d);
|
||||
}
|
||||
|
||||
// 3.5.10 CompareISODate ( y1, m1, d1, y2, m2, d2 ), https://tc39.es/proposal-temporal/#sec-temporal-compareisodate
|
||||
|
||||
Reference in New Issue
Block a user