calendar-not-supporting-eras.js (1011B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2024 Igalia, S.L. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.plainmonthday.from 7 description: era and eraYear are ignored (for calendars not using eras) 8 includes: [temporalHelpers.js] 9 features: [Temporal] 10 ---*/ 11 12 const result = Temporal.PlainMonthDay.from({ 13 era: "foobar", 14 eraYear: 1, 15 monthCode: "M01", 16 day: 1, 17 calendar: "iso8601", 18 }); 19 TemporalHelpers.assertPlainMonthDay(result, "M01", 1, 20 "era and eraYear are ignored for calendar not using eras (iso8601)"); 21 22 const resultChinese = Temporal.PlainMonthDay.from({ 23 era: "foobar", 24 eraYear: 1, 25 monthCode: "M01", 26 day: 1, 27 calendar: "chinese", 28 }); 29 TemporalHelpers.assertPlainMonthDay(resultChinese, "M01", 1, 30 "era and eraYear are ignored for calendar not using eras (Chinese)"); 31 assert.sameValue(resultChinese.calendarId, "chinese"); 32 33 reportCompare(0, 0);