-
Notifications
You must be signed in to change notification settings - Fork 156
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
CalendarMonthDayToISOReferenceDate: Allow to throw RangeError for too large inputs? #3002
Comments
I'm less sure about this because how do we define "too large" per calendar? 999999999-01-30 may be impossible to verify in the Chinese calendar, but you can easily verify whether an arbitrarily large year has an 02-29 in the Gregorian calendar, as long as it's a safe integer. We could alternatively say that the year can be disregarded if it corresponds to an ISO year that's outside the range [-271821, 275760]? |
By "disregarded" do you mean throw a RangeError? |
No, just ignored. So Anba's original example, FWIW, now that I think about this more, I like it less, because it'd actually be weirder for the Gregorian calendar; you could pass |
I'll prepare a speculative PR for what I described above, with throwing. I think it should not apply to the ISO calendar. That's similar to what we have in CalendarResolveFields (see the note at the bottom of the operation) where we allow This should probably also have test262 tests. |
Implementations should be allowed to throw a
RangeError
for too large[[Year]]
/[[EraYear]]
values inCalendarMonthDayToISOReferenceDate
, because performing field validation with arbitrarily large years is impossible to implement.Example: This case requires validating that the first month has thirty days in the year 999_999_999.
The text was updated successfully, but these errors were encountered: