Browse Source

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
Timothy Flynn 2 years ago
parent
commit
0086a3acdb

+ 3 - 3
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<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma
         // h. Let value be duration.[[<valueSlot>]].
         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<PatternPartition> 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").

+ 4 - 4
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<RangeError>(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<RangeError>(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