-
Notifications
You must be signed in to change notification settings - Fork 182
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
Debug assertion failures with ECMA-262 Temporal.PlainDate minimum and maximum values #4917
Comments
Still reproduces with release 1.5, except that the assertions are changed: Chinese/Dangi:
IslamicObservational:
IslamicUmmAlQura:
|
Yeah, I managed to get these to work for much larger ranges (thousands of years) in #4904, but dates that far away (hundreds of thousands of years) still have precision issues. A few potential paths forward:
|
Can we have these assertions not fail outside of ranges where we expect the calendar to be well-behaved? |
Start time: 11:05
Options:
Proposal: Option 3 or 3a with data size bikeshed tbd after implementation. Temporal issues to be filed upstream motivated by option 4. Ask for Temporal to not be handwavy about this. Signoff: @sffc @Manishearth @nekevss @echeran (@hsivonen?) (@robertbastian?) |
Manish to file Temporal issue. |
Related to option 3a: might be worth investigating whether Observational and Saudi islamic could share the data cache. Maybe not, because we're already extremely efficient, with 2 bytes per year per calendar. |
I think that's unlikely but it's possible that there's an efficient way to represent their overlap. |
Thanks @Manishearth for filing tc39/proposal-temporal#2869 I found the Temporal invariants that lead to my position that we should enforce certain arithmetic behaviors in calendars we export. See my comment in the above issue. |
Evidence that ICU4C has similar problems but just doesn't have code assertions: |
The assertion Year offset too big to store can also be triggered when using years too far into the future or past: let cal = Chinese::new_always_calculating();
let era = Era::from_str("chinese").unwrap();
let month_code = MonthCode::from_str("M01").unwrap();
let date = cal.date_from_codes(era, 21206, month_code, 1).unwrap(); |
There are assertion failures when testing the minimum and maximum allowed
Temporal.PlainDate
values for the Chinese, Dangi, IslamicObservational, and IslamicUmmAlQura calendars.I don't know if #4904 will fix these issues, too.
(Tested with release 1.4.)
The text was updated successfully, but these errors were encountered: