mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibJS: Implement most of GetTemporalRelativeToOption
Now that we have the Temporal.PlainDate object, we can flesh out this AO for such relative-to objects.
This commit is contained in:
committed by
Andreas Kling
parent
521638642f
commit
06593b1894
@@ -53,8 +53,14 @@ ThrowCompletionOr<String> to_temporal_time_zone_identifier(VM& vm, Value tempora
|
||||
if (!temporal_time_zone_like.is_string())
|
||||
return vm.throw_completion<TypeError>(ErrorType::TemporalInvalidTimeZoneName, temporal_time_zone_like);
|
||||
|
||||
return to_temporal_time_zone_identifier(vm, temporal_time_zone_like.as_string().utf8_string_view());
|
||||
}
|
||||
|
||||
// 11.1.8 ToTemporalTimeZoneIdentifier ( temporalTimeZoneLike ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaltimezoneidentifier
|
||||
ThrowCompletionOr<String> to_temporal_time_zone_identifier(VM& vm, StringView temporal_time_zone_like)
|
||||
{
|
||||
// 3. Let parseResult be ? ParseTemporalTimeZoneString(temporalTimeZoneLike).
|
||||
auto parse_result = TRY(parse_temporal_time_zone_string(vm, temporal_time_zone_like.as_string().utf8_string_view()));
|
||||
auto parse_result = TRY(parse_temporal_time_zone_string(vm, temporal_time_zone_like));
|
||||
|
||||
// 4. Let offsetMinutes be parseResult.[[OffsetMinutes]].
|
||||
// 5. If offsetMinutes is not empty, return FormatOffsetTimeZoneIdentifier(offsetMinutes).
|
||||
|
||||
Reference in New Issue
Block a user