Explorar o código

LibJS: Rename MatchBehavior members back to their old names

I changed this in 6ef1a27 to "match the spec", but the spec calls it
`match exactly` and `match minutes` - so what we had before was correct
and the change made no sense whatsoever.
Linus Groh %!s(int64=3) %!d(string=hai) anos
pai
achega
0d9defdad8

+ 2 - 2
Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp

@@ -535,7 +535,7 @@ ThrowCompletionOr<Value> to_relative_temporal_object(GlobalObject& global_object
     auto offset_behavior = OffsetBehavior::Option;
     auto offset_behavior = OffsetBehavior::Option;
 
 
     // 5. Let matchBehaviour be match exactly.
     // 5. Let matchBehaviour be match exactly.
-    auto match_behavior = MatchBehavior::Exactly;
+    auto match_behavior = MatchBehavior::MatchExactly;
 
 
     ISODateTime result;
     ISODateTime result;
     Value offset_string;
     Value offset_string;
@@ -622,7 +622,7 @@ ThrowCompletionOr<Value> to_relative_temporal_object(GlobalObject& global_object
         }
         }
 
 
         // h. Set matchBehaviour to match minutes.
         // h. Set matchBehaviour to match minutes.
-        match_behavior = MatchBehavior::Minutes;
+        match_behavior = MatchBehavior::MatchMinutes;
 
 
         // See NOTE above about why this is done.
         // See NOTE above about why this is done.
         result = move(parsed_result.date_time);
         result = move(parsed_result.date_time);

+ 3 - 3
Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp

@@ -93,7 +93,7 @@ ThrowCompletionOr<BigInt const*> interpret_iso_date_time_offset(GlobalObject& gl
         }
         }
 
 
         // c. If matchBehaviour is match minutes, then
         // c. If matchBehaviour is match minutes, then
-        if (match_behavior == MatchBehavior::Minutes) {
+        if (match_behavior == MatchBehavior::MatchMinutes) {
             // i. Let roundedCandidateNanoseconds be ! RoundNumberToIncrement(candidateNanoseconds, 60 × 10^9, "halfExpand").
             // i. Let roundedCandidateNanoseconds be ! RoundNumberToIncrement(candidateNanoseconds, 60 × 10^9, "halfExpand").
             auto rounded_candidate_nanoseconds = round_number_to_increment(candidate_nanoseconds, 60000000000, "halfExpand"sv);
             auto rounded_candidate_nanoseconds = round_number_to_increment(candidate_nanoseconds, 60000000000, "halfExpand"sv);
 
 
@@ -129,7 +129,7 @@ ThrowCompletionOr<ZonedDateTime*> to_temporal_zoned_date_time(GlobalObject& glob
     auto offset_behavior = OffsetBehavior::Option;
     auto offset_behavior = OffsetBehavior::Option;
 
 
     // 3. Let matchBehaviour be match exactly.
     // 3. Let matchBehaviour be match exactly.
-    auto match_behavior = MatchBehavior::Exactly;
+    auto match_behavior = MatchBehavior::MatchExactly;
 
 
     Object* calendar = nullptr;
     Object* calendar = nullptr;
     Object* time_zone = nullptr;
     Object* time_zone = nullptr;
@@ -222,7 +222,7 @@ ThrowCompletionOr<ZonedDateTime*> to_temporal_zoned_date_time(GlobalObject& glob
         calendar = TRY(to_temporal_calendar_with_iso_default(global_object, js_string(vm, parsed_result.date_time.calendar.value())));
         calendar = TRY(to_temporal_calendar_with_iso_default(global_object, js_string(vm, parsed_result.date_time.calendar.value())));
 
 
         // j. Set matchBehaviour to match minutes.
         // j. Set matchBehaviour to match minutes.
-        match_behavior = MatchBehavior::Minutes;
+        match_behavior = MatchBehavior::MatchMinutes;
 
 
         // See NOTE above about why this is done.
         // See NOTE above about why this is done.
         result = move(parsed_result.date_time);
         result = move(parsed_result.date_time);

+ 2 - 2
Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h

@@ -47,8 +47,8 @@ enum class OffsetBehavior {
 };
 };
 
 
 enum class MatchBehavior {
 enum class MatchBehavior {
-    Exactly,
-    Minutes,
+    MatchExactly,
+    MatchMinutes,
 };
 };
 
 
 ThrowCompletionOr<BigInt const*> interpret_iso_date_time_offset(GlobalObject&, i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, OffsetBehavior offset_behavior, double offset_nanoseconds, Value time_zone, StringView disambiguation, StringView offset_option, MatchBehavior match_behavior);
 ThrowCompletionOr<BigInt const*> interpret_iso_date_time_offset(GlobalObject&, i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, OffsetBehavior offset_behavior, double offset_nanoseconds, Value time_zone, StringView disambiguation, StringView offset_option, MatchBehavior match_behavior);