diff options
author | Linus Groh <mail@linusgroh.de> | 2021-07-18 21:41:29 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-19 00:34:28 +0100 |
commit | 152251f5a74f638f707145887748cb6a155b6401 (patch) | |
tree | 1cfb83d2328d89c7b457d2b4afc8a60aa2aa2a04 /Userland/Libraries/LibJS/Runtime | |
parent | 7ae46ae218ba2a607e1cfe75972ec85f4af517af (diff) | |
download | serenity-152251f5a74f638f707145887748cb6a155b6401.zip |
LibJS: Move Temporal AO structs/enum classes above function declarations
This is a bit closer to our usual style, and tidier.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index 9957a3bc2c..82f19b84c2 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -12,17 +12,12 @@ namespace JS::Temporal { -Object* get_options_object(GlobalObject&, Value options); enum class OptionType { Boolean, String, Number }; -Value get_option(GlobalObject&, Object& options, String const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback); -String to_temporal_rounding_mode(GlobalObject&, Object& normalized_options, String const& fallback); -u64 to_temporal_rounding_increment(GlobalObject&, Object& normalized_options, Optional<double> dividend, bool inclusive); -Optional<String> to_smallest_temporal_unit(GlobalObject&, Object& normalized_options, Vector<StringView> const& disallowed_units, Optional<String> fallback); -BigInt* round_number_to_increment(GlobalObject&, BigInt const&, u64 increment, String const& rounding_mode); + struct ISODateTime { i32 year; i32 month; @@ -35,7 +30,7 @@ struct ISODateTime { i32 nanosecond; Optional<String> calendar; }; -Optional<ISODateTime> parse_iso_date_time(GlobalObject&, String const& iso_string); + struct TemporalInstant { i32 year; i32 month; @@ -48,12 +43,21 @@ struct TemporalInstant { i32 nanosecond; Optional<String> time_zone_offset; }; -Optional<TemporalInstant> parse_temporal_instant_string(GlobalObject&, String const& iso_string); + struct TemporalTimeZone { bool z; Optional<String> offset; Optional<String> name; }; + +Object* get_options_object(GlobalObject&, Value options); +Value get_option(GlobalObject&, Object& options, String const& property, Vector<OptionType> const& types, Vector<StringView> const& values, Value fallback); +String to_temporal_rounding_mode(GlobalObject&, Object& normalized_options, String const& fallback); +u64 to_temporal_rounding_increment(GlobalObject&, Object& normalized_options, Optional<double> dividend, bool inclusive); +Optional<String> to_smallest_temporal_unit(GlobalObject&, Object& normalized_options, Vector<StringView> const& disallowed_units, Optional<String> fallback); +BigInt* round_number_to_increment(GlobalObject&, BigInt const&, u64 increment, String const& rounding_mode); +Optional<ISODateTime> parse_iso_date_time(GlobalObject&, String const& iso_string); +Optional<TemporalInstant> parse_temporal_instant_string(GlobalObject&, String const& iso_string); Optional<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject&, String const& iso_string); } |