1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:27:45 +00:00

LibJS/Temporal: Unroll the loop in to_temporal_time_record

This is an editorial change in the Temporal spec.
See: tc39/proposal-temporal@8e80575
This commit is contained in:
Jonah 2022-11-16 18:33:14 -06:00 committed by Linus Groh
parent 00da2e86e6
commit b45225dbac
2 changed files with 83 additions and 38 deletions

View file

@ -72,19 +72,6 @@ struct TemporalTimeLikeRecordField {
PropertyKey property_name;
};
template<typename StructT, typename ValueT>
auto temporal_time_like_record_fields = [](VM& vm) {
using FieldT = TemporalTimeLikeRecordField<StructT, ValueT>;
return AK::Array {
FieldT { &StructT::hour, vm.names.hour },
FieldT { &StructT::minute, vm.names.minute },
FieldT { &StructT::second, vm.names.second },
FieldT { &StructT::millisecond, vm.names.millisecond },
FieldT { &StructT::microsecond, vm.names.microsecond },
FieldT { &StructT::nanosecond, vm.names.nanosecond },
};
};
enum class ToTemporalTimeRecordCompleteness {
Partial,
Complete,