mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibJS: Use new construct AO overload where easily applicable
This commit is contained in:
committed by
Linus Groh
parent
67e02f6ca6
commit
59ca435172
Notes:
sideshowbarker
2024-07-17 20:13:25 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/59ca435172a Pull-request: https://github.com/SerenityOS/serenity/pull/12136
@@ -110,11 +110,8 @@ ThrowCompletionOr<RelativeTimeFormat*> initialize_relative_time_format(GlobalObj
|
||||
// 18. Set relativeTimeFormat.[[Numeric]] to numeric.
|
||||
relative_time_format.set_numeric(numeric.as_string().string());
|
||||
|
||||
MarkedValueList arguments { vm.heap() };
|
||||
arguments.append(js_string(vm, locale));
|
||||
|
||||
// 19. Let relativeTimeFormat.[[NumberFormat]] be ! Construct(%NumberFormat%, « locale »).
|
||||
auto* number_format = MUST(construct(global_object, *global_object.intl_number_format_constructor(), move(arguments)));
|
||||
auto* number_format = MUST(construct(global_object, *global_object.intl_number_format_constructor(), js_string(vm, locale)));
|
||||
relative_time_format.set_number_format(static_cast<NumberFormat*>(number_format));
|
||||
|
||||
// 20. Let relativeTimeFormat.[[PluralRules]] be ! Construct(%PluralRules%, « locale »).
|
||||
|
||||
Reference in New Issue
Block a user