diff options
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 71dbd6ff64..1139aa3b54 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -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 |