mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Port Intl.DurationFormat to String
This commit is contained in:
committed by
Linus Groh
parent
4c8f7d76c4
commit
8dc4e05ecf
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/8dc4e05ecf Pull-request: https://github.com/SerenityOS/serenity/pull/17208 Reviewed-by: https://github.com/linusg ✅
@@ -99,7 +99,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> DurationFormatConstructor::construct(Fun
|
||||
duration_format->set_data_locale(move(result.data_locale));
|
||||
|
||||
// 16. Let prevStyle be the empty String.
|
||||
auto previous_style = DeprecatedString::empty();
|
||||
String previous_style {};
|
||||
|
||||
// 17. For each row of Table 1, except the header row, in table order, do
|
||||
for (auto const& duration_instances_component : duration_instances_components) {
|
||||
@@ -110,7 +110,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> DurationFormatConstructor::construct(Fun
|
||||
auto display_slot = duration_instances_component.set_display_slot;
|
||||
|
||||
// c. Let unit be the Unit value.
|
||||
auto unit = duration_instances_component.unit;
|
||||
auto unit = TRY_OR_THROW_OOM(vm, String::from_utf8(duration_instances_component.unit));
|
||||
|
||||
// d. Let valueList be the Values value.
|
||||
auto value_list = duration_instances_component.values;
|
||||
|
||||
Reference in New Issue
Block a user