Skip to content

Conversation

@catamorphism
Copy link
Contributor

And move functionality into one existing test and one new test.

And move functionality into one existing test and one new test.
@catamorphism catamorphism requested review from a team as code owners January 7, 2026 01:47
Comment on lines +15 to +18
for (const largestUnit of units) {
assert.throws(RangeError, () => from.until(to, { largestUnit }),
`Can't use ${largestUnit} as largestUnit for PlainDate`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is covered by test/built-ins/Temporal/PlainDate/prototype/until/largestunit-invalid-string.js

Comment on lines +20 to +23
for (const smallestUnit of units) {
assert.throws(RangeError, () => from.until(to, { smallestUnit }),
`Can't use ${smallestUnit} as smallestUnit for PlainDate`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this by test/built-ins/Temporal/PlainDate/prototype/until/smallestunit-invalid-string.js

Comment on lines +25 to +30
for (const largestUnit of units) {
for (const smallestUnit of units) {
assert.throws(RangeError, () => from.until(to, { largestUnit, smallestUnit }),
`Can't use ${largestUnit} and ${smallestUnit} as largestUnit and smallestUnit for PlainDate`);
assert.throws(RangeError, () => from.until(to, { smallestUnit, largestUnit }),
`Can't use ${smallestUnit} and ${largestUnit} as largestUnit and smallestUnit for PlainDate`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't covered yet, but I don't think we need the two calls in the loop (unless you meant to do something different in the second one?)

If we keep it, please add the parallel test for since

const date19970716 = Temporal.PlainDate.from("1997-07-16");
const date19971216 = Temporal.PlainDate.from("1997-12-16");
const date19971230 = Temporal.PlainDate.from("1997-12-30");
const date20110716 = Temporal.PlainDate.from("2011-07-16");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the corresponding change to the since test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants