From 5da8ae002015964c2cabcac4f7c8345c66a5dc56 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 30 Oct 2021 22:09:34 +0200 Subject: [PATCH] LibJS: Update parse_temporal_time_zone_string() substring bounds This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/73b9fe3 --- .../Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 3ab0c01fb8..d9ca09129c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -1005,9 +1005,9 @@ ThrowCompletionOr parse_temporal_time_zone_string(GlobalObject if (fraction_part.has_value()) { // i. Set fraction to the string-concatenation of the previous value of fraction and the string "000000000". auto fraction = String::formatted("{}000000000", *fraction_part); - // ii. Let nanoseconds be the String value equal to the substring of fraction from 0 to 9. + // ii. Let nanoseconds be the String value equal to the substring of fraction from 1 to 10. // iii. Set nanoseconds to ! ToIntegerOrInfinity(nanoseconds). - nanoseconds = MUST(Value(js_string(vm, fraction.substring(0, 9))).to_integer_or_infinity(global_object)); + nanoseconds = MUST(Value(js_string(vm, fraction.substring(1, 10))).to_integer_or_infinity(global_object)); } // h. Else, else {