Closed
Bug 2005482
Opened 11 months ago
Closed 11 months ago
Constrain day before calling CreateDateFromCodes with overflow=reject for Hebrew calendar
Categories
(Core :: JavaScript: Standard Library, defect, P1)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
148 Branch
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
New test262 tests added in bug 2005286 revealed a bug in CreateDateFrom for the Hebrew calendar:
- When given an ordinal month, we first call
CreateDateFromCodeswith the ordinal month replaced by a month code. If the resolved date has the same ordinal month as the input month, we return that date. Otherwise we try to adjust for leap years. CreateDateFromCodeshas an early check for invalid day values. This can result in rejecting valid inputs:- For example when
month = 10andday = 30and the input year is a leap year. This should resolve tomonthCode = M09andday = 30. We first try month code "M10", but since "M10" can have at most 29 days, the early day values check inCreateDateFromCodesthrows aRangeError.
- For example when
To fix this bug, we need to constrain the days value before calling CreateDateFromCodes and later check if input day fits into the resolved month.
| Assignee | ||
Comment 1•11 months ago
|
||
Constrain the input day before calling CreateDateFromCodes when
overflow=reject to avoid incorrectly rejecting dates. When the day was
constrained, handle overflow=reject through an explicit check using
CalendarDaysInMonth.
This case is specific to the Hebrew calendar and can't happen for Chinese/Dangi
calendars, because all Chinese/Dangi months have the same number of minimum resp.
maximum days per month.
Updated•11 months ago
|
Severity: -- → S3
Priority: -- → P1
Pushed by andre.bargull@gmail.com:
https://github.com/mozilla-firefox/firefox/commit/37099145c6fb
https://hg.mozilla.org/integration/autoland/rev/669b3bf32072
Constrain day before calling CreateDateFromCodes with overflow=reject for Hebrew calendar. r=spidermonkey-reviewers,dminor
Comment 3•11 months ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
status-firefox148:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
Updated•10 months ago
|
QA Whiteboard: [qa-triage-done-c149/b148]
You need to log in
before you can comment on or make changes to this bug.
Description
•