diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/add/options-read-before-algorithmic-validation.js b/test/built-ins/Temporal/PlainYearMonth/prototype/add/options-read-before-algorithmic-validation.js index 3f9bb7bbd37..e93e660308c 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/add/options-read-before-algorithmic-validation.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/add/options-read-before-algorithmic-validation.js @@ -26,3 +26,12 @@ assert.throws(RangeError, function () { instance.add(new Temporal.Duration(0, 1), options); }, "exception thrown when converting -271821-04 to date"); assert.compareArray(actual, expected, "all options should be read first"); + +actual.splice(0); // clear + +const instance2 = new Temporal.PlainYearMonth(1999, 12); + +assert.throws(RangeError, function () { + instance2.add(new Temporal.Duration(0, 0, 1), options); +}, "exception thrown when attempting to add too-low unit"); +assert.compareArray(actual, expected, "all options should be read first"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-read-before-algorithmic-validation.js b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-read-before-algorithmic-validation.js index 96873b0eb10..ee5d9c6e5f3 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-read-before-algorithmic-validation.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-read-before-algorithmic-validation.js @@ -26,3 +26,12 @@ assert.throws(RangeError, function () { instance.subtract(new Temporal.Duration(0, -1), options); }, "exception thrown when converting -271821-04 to date"); assert.compareArray(actual, expected, "all options should be read first"); + +actual.splice(0); // clear + +const instance2 = new Temporal.PlainYearMonth(1999, 12); + +assert.throws(RangeError, function () { + instance2.add(new Temporal.Duration(0, 0, 1), options); +}, "exception thrown when attempting to add too-low unit"); +assert.compareArray(actual, expected, "all options should be read first");