mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:47:45 +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:
parent
18122c0368
commit
90b43712e6
8 changed files with 70 additions and 68 deletions
|
@ -61,17 +61,17 @@ ThrowCompletionOr<NonnullGCPtr<Object>> PlainYearMonthConstructor::construct(Fun
|
|||
reference_iso_day = Value(1);
|
||||
}
|
||||
|
||||
// 3. Let y be ? ToIntegerThrowOnInfinity(isoYear).
|
||||
auto y = TRY(to_integer_throw_on_infinity(vm, iso_year, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
// 3. Let y be ? ToIntegerWithTruncation(isoYear).
|
||||
auto y = TRY(to_integer_with_truncation(vm, iso_year, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
|
||||
// 4. Let m be ? ToIntegerThrowOnInfinity(isoMonth).
|
||||
auto m = TRY(to_integer_throw_on_infinity(vm, iso_month, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
// 4. Let m be ? ToIntegerWithTruncation(isoMonth).
|
||||
auto m = TRY(to_integer_with_truncation(vm, iso_month, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
|
||||
// 5. Let calendar be ? ToTemporalCalendarWithISODefault(calendarLike).
|
||||
auto* calendar = TRY(to_temporal_calendar_with_iso_default(vm, calendar_like));
|
||||
|
||||
// 6. Let ref be ? ToIntegerThrowOnInfinity(referenceISODay).
|
||||
auto ref = TRY(to_integer_throw_on_infinity(vm, reference_iso_day, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
// 6. Let ref be ? ToIntegerWithTruncation(referenceISODay).
|
||||
auto ref = TRY(to_integer_with_truncation(vm, reference_iso_day, ErrorType::TemporalInvalidPlainYearMonth));
|
||||
|
||||
// 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 CreateTemporalYearMonth will immediately check that these values are valid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue