1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibJS: Reflect Record wording editorial change in the Temporal spec

See: c8f14d0
This commit is contained in:
Linus Groh 2021-08-17 20:38:29 +01:00
parent 74ee1c9a8c
commit 0cdad283c0
7 changed files with 13 additions and 13 deletions

View file

@ -461,7 +461,7 @@ Optional<ISODateTime> parse_iso_date_time(GlobalObject& global_object, [[maybe_u
return {};
}
// 18. Return the new Record { [[Year]]: year, [[Month]]: month, [[Day]]: day, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond, [[Calendar]]: calendar }.
// 18. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond, [[Calendar]]: calendar }.
return ISODateTime { .year = year, .month = month, .day = day, .hour = hour, .minute = minute, .second = second, .millisecond = millisecond, .microsecond = microsecond, .nanosecond = nanosecond, .calendar = calendar_part.has_value() ? *calendar_part : Optional<String>() };
}
@ -487,7 +487,7 @@ Optional<TemporalInstant> parse_temporal_instant_string(GlobalObject& global_obj
// 5. Assert: timeZoneResult.[[OffsetString]] is not undefined.
VERIFY(time_zone_result->offset.has_value());
// 6. Return the new Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[Hour]]: result.[[Hour]], [[Minute]]: result.[[Minute]], [[Second]]: result.[[Second]], [[Millisecond]]: result.[[Millisecond]], [[Microsecond]]: result.[[Microsecond]], [[Nanosecond]]: result.[[Nanosecond]], [[TimeZoneOffsetString]]: timeZoneResult.[[OffsetString]] }.
// 6. Return the Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[Hour]]: result.[[Hour]], [[Minute]]: result.[[Minute]], [[Second]]: result.[[Second]], [[Millisecond]]: result.[[Millisecond]], [[Microsecond]]: result.[[Microsecond]], [[Nanosecond]]: result.[[Nanosecond]], [[TimeZoneOffsetString]]: timeZoneResult.[[OffsetString]] }.
return TemporalInstant { .year = result->year, .month = result->month, .day = result->day, .hour = result->hour, .minute = result->minute, .second = result->second, .millisecond = result->millisecond, .microsecond = result->microsecond, .nanosecond = result->nanosecond, .time_zone_offset = move(time_zone_result->offset) };
}
@ -528,7 +528,7 @@ Optional<TemporalDate> parse_temporal_date_string(GlobalObject& global_object, S
if (vm.exception())
return {};
// 4. Return the new Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[Calendar]]: result.[[Calendar]] }.
// 4. Return the Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[Calendar]]: result.[[Calendar]] }.
return TemporalDate { .year = result->year, .month = result->month, .day = result->day, .calendar = move(result->calendar) };
}
@ -561,7 +561,7 @@ Optional<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject& global_
// 4. If z is not undefined, then
if (z_part.has_value()) {
// a. Return the new Record: { [[Z]]: "Z", [[OffsetString]]: "+00:00", [[Name]]: undefined }.
// a. Return the Record { [[Z]]: "Z", [[OffsetString]]: "+00:00", [[Name]]: undefined }.
return TemporalTimeZone { .z = true, .offset = "+00:00", .name = {} };
}
@ -629,7 +629,7 @@ Optional<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject& global_
name = canonicalize_time_zone_name(*name_part);
}
// 8. Return the new Record: { [[Z]]: undefined, [[OffsetString]]: offsetString, [[Name]]: name }.
// 8. Return the Record { [[Z]]: undefined, [[OffsetString]]: offsetString, [[Name]]: name }.
return TemporalTimeZone { .z = false, .offset = offset, .name = name };
}

View file

@ -813,7 +813,7 @@ Optional<ISOYearMonth> iso_year_month_from_fields(GlobalObject& global_object, O
if (vm.exception())
return {};
// 8. Return the new Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[ReferenceISODay]]: 1 }.
// 8. Return the Record { [[Year]]: result.[[Year]], [[Month]]: result.[[Month]], [[ReferenceISODay]]: 1 }.
return ISOYearMonth { .year = result->year, .month = result->month, .reference_iso_day = 1 };
}
@ -892,7 +892,7 @@ Optional<ISOMonthDay> iso_month_day_from_fields(GlobalObject& global_object, Obj
return {};
}
// 14. Return the new Record { [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[ReferenceISOYear]]: referenceISOYear }.
// 14. Return the Record { [[Month]]: result.[[Month]], [[Day]]: result.[[Day]], [[ReferenceISOYear]]: referenceISOYear }.
return ISOMonthDay { .month = result->month, .day = result->day, .reference_iso_year = reference_iso_year };
}

View file

@ -191,7 +191,7 @@ PartialDuration to_partial_duration(GlobalObject& global_object, Value temporal_
return {};
}
// 2. Let result be the new Record { [[Years]]: undefined, [[Months]]: undefined, [[Weeks]]: undefined, [[Days]]: undefined, [[Hours]]: undefined, [[Minutes]]: undefined, [[Seconds]]: undefined, [[Milliseconds]]: undefined, [[Microseconds]]: undefined, [[Nanoseconds]]: undefined }.
// 2. Let result be the Record { [[Years]]: undefined, [[Months]]: undefined, [[Weeks]]: undefined, [[Days]]: undefined, [[Hours]]: undefined, [[Minutes]]: undefined, [[Seconds]]: undefined, [[Milliseconds]]: undefined, [[Microseconds]]: undefined, [[Nanoseconds]]: undefined }.
auto result = PartialDuration {};
// 3. Let any be false.

View file

@ -328,7 +328,7 @@ ISODate balance_iso_date(double year_, double month_, double day)
month = balanced_year_month.month;
}
// 16. Return the new Record { [[Year]]: year, [[Month]]: month, [[Day]]: day }.
// 16. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day }.
return ISODate { .year = year, .month = static_cast<u8>(month), .day = static_cast<u8>(day) };
}

View file

@ -119,7 +119,7 @@ DaysAndTime balance_time(i64 hour, i64 minute, i64 second, i64 millisecond, i64
// 13. Set hour to hour modulo 24.
hour %= 24;
// 14. Return the new Record { [[Days]]: days, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond }.
// 14. Return the Record { [[Days]]: days, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond }.
return DaysAndTime {
.days = static_cast<i32>(days),
.hour = static_cast<u8>(hour),

View file

@ -71,7 +71,7 @@ Optional<ISOYearMonth> regulate_iso_year_month(GlobalObject& global_object, doub
return {};
}
// b. Return the new Record { [[Year]]: year, [[Month]]: month }.
// b. Return the Record { [[Year]]: year, [[Month]]: month }.
return ISOYearMonth { .year = static_cast<i32>(year), .month = static_cast<u8>(month), .reference_iso_day = 0 };
}
@ -131,7 +131,7 @@ ISOYearMonth balance_iso_year_month(double year, double month)
// 3. Set month to (month 1) modulo 12 + 1.
month = fmod(month - 1, 12) + 1;
// 4. Return the new Record { [[Year]]: year, [[Month]]: month }.
// 4. Return the Record { [[Year]]: year, [[Month]]: month }.
return ISOYearMonth { .year = static_cast<i32>(year), .month = static_cast<u8>(month), .reference_iso_day = 0 };
}

View file

@ -156,7 +156,7 @@ Optional<ISODateTime> get_iso_parts_from_epoch(BigInt const& epoch_nanoseconds)
// 11. Let nanosecond be remainderNs modulo 1000.
auto nanosecond = static_cast<u16>(remainder_ns % 1000);
// 12. Return the new Record { [[Year]]: year, [[Month]]: month, [[Day]]: day, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond }.
// 12. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond }.
return ISODateTime { .year = year, .month = month, .day = day, .hour = hour, .minute = minute, .second = second, .millisecond = millisecond, .microsecond = microsecond, .nanosecond = nanosecond };
}