Skip to content

Commit 1f51778

Browse files
committed
Polyfill: Change check to assertion in minMaxMonthLength for Hebrew calendar
This is called on dates that have already been validated, so it should be an internal error if there is no length for a valid month code.
1 parent 03f9057 commit 1f51778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

polyfill/lib/calendar.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ const helperHebrew = makeNonISOHelper([{ code: 'am', isoEpoch: { year: -3760, mo
12801280
const { month, year } = calendarDate;
12811281
const monthCode = calendarDate.monthCode ?? this.getMonthCode(year, month);
12821282
const daysInMonth = this.monthLengths[monthCode];
1283-
if (daysInMonth === undefined) throw new RangeErrorCtor(`unmatched Hebrew month: ${month}`);
1283+
assert(daysInMonth, 'missing daysInMonth for Hebrew month ${monthCode}`);
12841284
return typeof daysInMonth === 'number' ? daysInMonth : daysInMonth[minOrMax];
12851285
},
12861286
maxLengthOfMonthCodeInAnyYear(monthCode) {

0 commit comments

Comments
 (0)