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

CalendarResolveFields: Inconsistent field checked too early and wrong error type? #2866

Open
anba opened this issue May 27, 2024 · 1 comment

Comments

@anba
Copy link
Contributor

anba commented May 27, 2024

CalendarResolveFields has the following two requirements:

The operation throws a TypeError exception if the properties of fields are internally inconsistent within the calendar or insufficient to identify a unique instance of type in the calendar. For example:

  • If "month" and "monthCode" in the calendar have interpretations analogous to ISO 8601 and either the corresponding values for both are undefined or neither value is undefined but they do not identify the same month.
    ...
  • If type is date or year-month and [...] the values for "era" and "eraYear" do not together identify the same year as the value for "year".

Questions:

  • Is it correct to throw a TypeError? The ISO-8601 calendar throws a RangeError when month and monthCode are inconsistent.
  • Is it possible to check for inconsistent year/eraYear resp. month/monthCode this early? For example to validate that the month code M03 identifies the same month as the ordinal month number 4 in the Chinese calendar, it's first necessary to resolve the complete date (, because leap months can appear after any month, so there can be a leap month M01L or M02L, which makes M03 the fourth month of the year).
@justingrant
Copy link
Collaborator

Meeting 2024-05-30: @gibson042 to follow up and propose behavior here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants