From f09d2ae395bd88d59419e72d227321ab69ab858b Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sat, 11 Feb 2023 00:39:05 +0000 Subject: [PATCH] LibJS: Add missing assignment to offset_string in ZDT conversion --- Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index 3bc753fba4..88fdbdc9ff 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2023, Linus Groh - * Copyright (c) 2021, Luke Wilde + * Copyright (c) 2021-2023, Luke Wilde * * SPDX-License-Identifier: BSD-2-Clause */ @@ -174,6 +174,9 @@ ThrowCompletionOr to_temporal_zoned_date_time(VM& vm, Value item if (offset_string_value.is_undefined()) { // i. Set offsetBehaviour to wall. offset_behavior = OffsetBehavior::Wall; + } else { + // NOTE: Not in the spec, since it directly assigns to offsetString in step i, but we can't do it there as it's a type mismatch. + offset_string = TRY(offset_string_value.as_string().utf8_string()); } // l. Let result be ? InterpretTemporalDateTimeFields(calendar, fields, options).