-
Notifications
You must be signed in to change notification settings - Fork 171
Closed
Labels
editorialnon-prod-polyfillTHIS POLYFILL IS NOT FOR PRODUCTION USE!THIS POLYFILL IS NOT FOR PRODUCTION USE!spec-textSpecification text involvedSpecification text involved
Milestone
Description
RoundDuration, step 9.y can perform a division by zero:
Let fractionalYears be years + days / abs(oneYearDays).
Test case:
let d = Temporal.Duration.from({
nanoseconds: 0,
});
let cal = new class extends Temporal.Calendar {
dateAdd(date, duration, options) {
if (duration.years === 1) {
return date;
}
return super.dateAdd(date, duration, options);
}
}("iso8601");
let date = new Temporal.PlainDate(1970, 1, 1, cal);
let r = d.round({
relativeTo: date,
smallestUnit: "years",
});Metadata
Metadata
Assignees
Labels
editorialnon-prod-polyfillTHIS POLYFILL IS NOT FOR PRODUCTION USE!THIS POLYFILL IS NOT FOR PRODUCTION USE!spec-textSpecification text involvedSpecification text involved