LibJS: Pass time zone strings around as String more regularly

These are String from the outset, so this patch is almost entirely just
changing function parameter types. This will allow us to cache time zone
parse results without invoking any extra allocations.
This commit is contained in:
Timothy Flynn
2026-02-18 12:37:01 -05:00
committed by Jelle Raaijmakers
parent d065f6bf00
commit f9fa548d43
Notes: github-actions[bot] 2026-02-19 08:21:38 +00:00
11 changed files with 58 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
* Copyright (c) 2024-2025, Tim Flynn <trflynn89@ladybird.org>
* Copyright (c) 2024-2026, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -69,7 +69,7 @@ ThrowCompletionOr<GC::Ref<Object>> ZonedDateTimeConstructor::construct(FunctionO
return vm.throw_completion<TypeError>(ErrorType::NotAString, time_zone_value);
// 5. Let timeZoneParse be ? ParseTimeZoneIdentifier(timeZone).
auto time_zone_parse = TRY(parse_time_zone_identifier(vm, time_zone_value.as_string().utf8_string_view()));
auto time_zone_parse = TRY(parse_time_zone_identifier(vm, time_zone_value.as_string().utf8_string()));
String time_zone;