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

LibJS: Update Temporal's GetPossibleInstantsFor to latest spec

The most noteworthy change is that we now pass through a Time Zone
Methods Record to this function instead of a raw object.
This commit is contained in:
Shannon Booth 2024-02-25 23:45:34 +13:00 committed by Andreas Kling
parent aa9cdc2205
commit 230ffc022c
3 changed files with 72 additions and 30 deletions

View file

@ -81,7 +81,8 @@ ThrowCompletionOr<BigInt const*> interpret_iso_date_time_offset(VM& vm, i32 year
VERIFY(offset_option.is_one_of("prefer"sv, "reject"sv));
// 7. Let possibleInstants be ? GetPossibleInstantsFor(timeZone, dateTime).
auto possible_instants = TRY(get_possible_instants_for(vm, time_zone, *date_time));
auto time_zone_record = TRY(create_time_zone_methods_record(vm, NonnullGCPtr<Object> { time_zone.as_object() }, { { TimeZoneMethod::GetPossibleInstantsFor } }));
auto possible_instants = TRY(get_possible_instants_for(vm, time_zone_record, *date_time));
// 8. For each element candidate of possibleInstants, do
for (auto candidate : possible_instants) {