// |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.plaindatetime.from description: Month codes that are invalid for Hebrew calendar features: [Temporal, Intl.Era-monthcode] ---*/ const calendar = "hebrew"; assert.throws(RangeError, () => { Temporal.PlainDateTime.from({ year: 5779, monthCode: "M13", day: 1, hour: 12, minute: 34, 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.PlainDateTime.from({ year: 5779, monthCode, day: 1, hour: 12, minute: 34, calendar }); }); } reportCompare(0, 0);