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

LibJS: Rename ToIntegerThrowOnInfinity to ToIntegerWithTruncation

This commit ticks away two of the boxes in #15525
Temporal commits: tc39/proposal-temporal@f274678 and
tc39/proposal-temporal@a63a0fb
This commit is contained in:
BodilessSleeper 2023-01-06 03:31:29 +01:00 committed by Linus Groh
parent 18122c0368
commit 90b43712e6
8 changed files with 70 additions and 68 deletions

View file

@ -59,17 +59,17 @@ ThrowCompletionOr<NonnullGCPtr<Object>> PlainMonthDayConstructor::construct(Func
reference_iso_year = Value(1972);
}
// 3. Let m be ? ToIntegerThrowOnInfinity(isoMonth).
auto m = TRY(to_integer_throw_on_infinity(vm, iso_month, ErrorType::TemporalInvalidPlainMonthDay));
// 3. Let m be ? ToIntegerWithTruncation(isoMonth).
auto m = TRY(to_integer_with_truncation(vm, iso_month, ErrorType::TemporalInvalidPlainMonthDay));
// 4. Let d be ? ToIntegerThrowOnInfinity(isoDay).
auto d = TRY(to_integer_throw_on_infinity(vm, iso_day, ErrorType::TemporalInvalidPlainMonthDay));
// 4. Let d be ? ToIntegerWithTruncation(isoDay).
auto d = TRY(to_integer_with_truncation(vm, iso_day, ErrorType::TemporalInvalidPlainMonthDay));
// 5. Let calendar be ? ToTemporalCalendarWithISODefault(calendarLike).
auto* calendar = TRY(to_temporal_calendar_with_iso_default(vm, calendar_like));
// 6. Let ref be ? ToIntegerThrowOnInfinity(referenceISOYear).
auto ref = TRY(to_integer_throw_on_infinity(vm, reference_iso_year, ErrorType::TemporalInvalidPlainMonthDay));
// 6. Let ref be ? ToIntegerWithTruncation(referenceISOYear).
auto ref = TRY(to_integer_with_truncation(vm, reference_iso_year, ErrorType::TemporalInvalidPlainMonthDay));
// IMPLEMENTATION DEFINED: This is an optimization that allows us to treat these doubles as normal integers from this point onwards.
// This does not change the exposed behavior as the call to CreateTemporalMonthDay will immediately check that these values are valid