Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalendarYearMonthFromFields: No longer possible to set to minimum valid year-month for non-ISO8601 calendars #2998

Closed
anba opened this issue Oct 7, 2024 · 3 comments
Labels

Comments

@anba
Copy link
Contributor

anba commented Oct 7, 2024

js> new Temporal.PlainYearMonth(2000, 4, "gregory").with({year: -271821})
typein:1:49 RangeError: year-month-day must be valid iso dates

CalendarYearMonthFromFields calls CalendarDateToISO, which has:

It also throws a RangeError exception if the date described by fields is outside the range allowed by ISODateWithinLimits.

@ptomato
Copy link
Collaborator

ptomato commented Oct 7, 2024

I believe this is fixed in #2996. Specifically, in 013fa0e.

@ptomato ptomato added spec-text Specification text involved editorial labels Oct 7, 2024
@ptomato ptomato self-assigned this Oct 7, 2024
ptomato added a commit that referenced this issue Oct 7, 2024
Move the ISO 8601 code from CalendarDateFromFields and
CalendarYearMonthFromFields into CalendarDateToISO. At this point it just
consists of RegulateISODate anyway.

To achieve this, we also drop the requirement that CalendarDateToISO
checks its return value is in the representable range, instead moving that
to CalendarDateFromFields and CalendarYearMonthFromFields since it is
different in both cases.

See: #2948
Closes: #2998
@ptomato ptomato closed this as completed in f3997eb Oct 7, 2024
@ptomato
Copy link
Collaborator

ptomato commented Oct 7, 2024

This is indeed fixed now. However, it should be covered by test262 tests. I'll reopen it for that purpose.

@catamorphism
Copy link
Contributor

Done in tc39/test262#4300

@ptomato ptomato closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants