From 0086a3acdbe2af06bae4c45523b20c7bbb19ab90 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 14 Dec 2022 14:58:08 -0500 Subject: [PATCH] LibJS: Remove infallibility markers from some Intl.DurationFormat AOs This is an editorial change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/fa2b3d0 --- Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp | 6 +++--- .../LibJS/Runtime/Intl/DurationFormatPrototype.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index 9b555a7046..076cc5e786 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -204,7 +204,7 @@ i8 duration_record_sign(Temporal::DurationRecord const& record) // 1.1.5 IsValidDurationRecord ( record ), https://tc39.es/proposal-intl-duration-format/#sec-isvaliddurationrecord bool is_valid_duration_record(Temporal::DurationRecord const& record) { - // 1. Let sign be ! DurationRecordSign(record). + // 1. Let sign be DurationRecordSign(record). auto sign = duration_record_sign(record); // 2. For each row of Table 1, except the header row, in table order, do @@ -338,7 +338,7 @@ Vector partition_duration_format_pattern(VM& vm, DurationForma // h. Let value be duration.[[]]. auto value = duration.*value_slot; - // i. Let nfOpts be ! OrdinaryObjectCreate(null). + // i. Let nfOpts be OrdinaryObjectCreate(null). auto number_format_options = Object::create(realm, nullptr); // j. If unit is "seconds", "milliseconds", or "microseconds", then @@ -485,7 +485,7 @@ Vector partition_duration_format_pattern(VM& vm, DurationForma } } - // 4. Let lfOpts be ! OrdinaryObjectCreate(null). + // 4. Let lfOpts be OrdinaryObjectCreate(null). auto list_format_options = Object::create(realm, nullptr); // 5. Perform ! CreateDataPropertyOrThrow(lfOpts, "type", "unit"). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp index f3092b7eb7..d3435c8958 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp @@ -46,7 +46,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::format) if (!is_valid_duration_record(record)) return vm.throw_completion(ErrorType::TemporalInvalidDurationLikeObject); - // 5. Let parts be ! PartitionDurationFormatPattern(df, record). + // 5. Let parts be PartitionDurationFormatPattern(df, record). auto parts = partition_duration_format_pattern(vm, *duration_format, record); // 6. Let result be a new empty String. @@ -78,7 +78,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::format_to_parts) if (!is_valid_duration_record(record)) return vm.throw_completion(ErrorType::TemporalInvalidDurationLikeObject); - // 5. Let parts be ! PartitionDurationFormatPattern(df, record). + // 5. Let parts be PartitionDurationFormatPattern(df, record). auto parts = partition_duration_format_pattern(vm, *duration_format, record); // 6. Let result be ! ArrayCreate(0). @@ -89,7 +89,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::format_to_parts) for (size_t n = 0; n < parts.size(); ++n) { auto const& part = parts[n]; - // a. Let obj be ! OrdinaryObjectCreate(%ObjectPrototype%). + // a. Let obj be OrdinaryObjectCreate(%ObjectPrototype%). auto object = Object::create(realm, realm.intrinsics().object_prototype()); // b. Perform ! CreateDataPropertyOrThrow(obj, "type", part.[[Type]]). @@ -117,7 +117,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::resolved_options) // 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]). auto* duration_format = TRY(typed_this_object(vm)); - // 3. Let options be ! OrdinaryObjectCreate(%Object.prototype%). + // 3. Let options be OrdinaryObjectCreate(%Object.prototype%). auto options = Object::create(realm, realm.intrinsics().object_prototype()); // 4. For each row of Table 2, except the header row, in table order, do