summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-06-14 21:44:33 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-15 17:49:20 +0100
commit810e9e32c9db360e0077b6a105dfa43d8bdf4269 (patch)
treeba837da8634ecf1ac7ab3019fd420ce14de019b7 /Userland/Libraries
parente96df3b7a719d2eaeb986f2515225c1aee19548f (diff)
downloadserenity-810e9e32c9db360e0077b6a105dfa43d8bdf4269.zip
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
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp11
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