Skip to content

Commit 36f1150

Browse files
committed
Polyfill: Require newDays argument in AdjustDateDurationRecord
AdjustDateDurationRecord is always called with a non-undefined `newDays`, so add an assertion to that effect and remove the ?? operator for `days`.
1 parent 03f9057 commit 36f1150

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

polyfill/lib/ecmascript.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,12 @@ export function ToTemporalPartialDurationRecord(temporalDurationLike) {
752752
}
753753

754754
export function AdjustDateDurationRecord({ years, months, weeks, days }, newDays, newWeeks, newMonths) {
755+
assert(newDays !== undefined, 'days must be provided to AdjustDateDurationRecord');
755756
return {
756757
years,
757758
months: newMonths ?? months,
758759
weeks: newWeeks ?? weeks,
759-
days: newDays ?? days
760+
days: newDays
760761
};
761762
}
762763

0 commit comments

Comments
 (0)