mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibJS: Port prepare_temporal_fields() and calendar_fields() to String
This commit is contained in:
parent
90a1de564c
commit
227379a1da
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/linusg
Commit: 227379a1da
Pull-request: https://github.com/SerenityOS/serenity/pull/17186
Reviewed-by: https://github.com/trflynn89 ✅
7 changed files with 45 additions and 21 deletions
|
@ -150,10 +150,10 @@ ThrowCompletionOr<ZonedDateTime*> to_temporal_zoned_date_time(VM& vm, Value item
|
|||
auto field_names = TRY(calendar_fields(vm, *calendar, { "day"sv, "hour"sv, "microsecond"sv, "millisecond"sv, "minute"sv, "month"sv, "monthCode"sv, "nanosecond"sv, "second"sv, "year"sv }));
|
||||
|
||||
// d. Append "timeZone" to fieldNames.
|
||||
field_names.append("timeZone");
|
||||
field_names.append(TRY_OR_THROW_OOM(vm, String::from_utf8("timeZone"sv)));
|
||||
|
||||
// e. Append "offset" to fieldNames.
|
||||
field_names.append("offset");
|
||||
field_names.append(TRY_OR_THROW_OOM(vm, String::from_utf8("offset"sv)));
|
||||
|
||||
// f. Let fields be ? PrepareTemporalFields(item, fieldNames, « "timeZone" »).
|
||||
auto* fields = TRY(prepare_temporal_fields(vm, item_object, field_names, Vector<StringView> { "timeZone"sv }));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue