-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fix out-of-range panics of Date #1075
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1075 +/- ##
==========================================
+ Coverage 58.68% 58.70% +0.02%
==========================================
Files 176 176
Lines 12395 12407 +12
==========================================
+ Hits 7274 7284 +10
- Misses 5121 5123 +2
Continue to review full report at Codecov.
|
2 less panics as expected. Test262 conformance changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
* Add overflow check when fixing year, month, and day * Add timeclip * Add timeclip to `Date.UTC()` * Minor fix * Fix comment * Add more range check * Add timeclip to all date creation * Remove redundant overflow check * Fix clippy
This Pull Request fixes/closes #1054
It changes the following:
time_clip
time_clip
to methods ofDate
Date
This PR resolves all known and unexplored out-of-range panics - more stable now. However, the test mentioned in the issue still failed. That is because the valid date range of
chrono::naive::NaiveDate
in Rust is smaller than the range ofDate
in JavaScript, which makes the behavior different.