summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-11-10 21:27:25 +0000
committerLinus Groh <mail@linusgroh.de>2021-11-10 21:27:25 +0000
commit6ef1a2793fb3d0c89cb6872fa30eaa8d542ddb5b (patch)
tree16440d10e6cfd8882d77717960af11e500386c32
parentf86ee71f654335a834b879f43a422937bee9cd57 (diff)
downloadserenity-6ef1a2793fb3d0c89cb6872fa30eaa8d542ddb5b.zip
LibJS: Rename ZonedDateTime's MatchBehavior enum members to match spec
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp
index 96c571edd2..c45f5ab4c1 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp
+++ b/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
- if (match_behavior == MatchBehavior::MatchMinutes) {
+ if (match_behavior == MatchBehavior::Minutes) {
// i. Let roundedCandidateNanoseconds be ! RoundNumberToIncrement(candidateNanoseconds, 60 × 10^9, "halfExpand").
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;
// 3. Let matchBehaviour be match exactly.
- auto match_behavior = MatchBehavior::MatchExactly;
+ auto match_behavior = MatchBehavior::Exactly;
Object* calendar = 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())));
// j. Set matchBehaviour to match minutes.
- match_behavior = MatchBehavior::MatchMinutes;
+ match_behavior = MatchBehavior::Minutes;
// See NOTE above about why this is done.
result = move(parsed_result.date_time);
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h
index 9dcd2a0e2a..7ffcdbaec2 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h
@@ -47,8 +47,8 @@ enum class OffsetBehavior {
};
enum class MatchBehavior {
- MatchExactly,
- MatchMinutes,
+ Exactly,
+ Minutes,
};
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);