Source code

Revision control

Copy as Markdown

Other Tools

// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.from
description: Month codes that are invalid for Hebrew calendar
features: [Temporal, Intl.Era-monthcode]
---*/
const calendar = "hebrew";
assert.throws(RangeError, () => {
Temporal.PlainDate.from({ year: 5779, monthCode: "M13", day: 1, calendar });
}, "M13 should not be a valid month code");
// Invalid leap months: e.g. M02L
for (var i = 1; i <= 12; i++) {
if (i === 5)
continue;
const monthCode = `M${ i.toString().padStart(2, "0") }L`;
assert.throws(RangeError, function () {
Temporal.PlainDate.from({ year: 5779, monthCode, day: 1, calendar });
});
}
reportCompare(0, 0);