Debian Codegraph @

js/src/tests/test262/intl402/Temporal/PlainMonthDay/from/calendar-not-supporting-eras.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
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 resultHebrew = Temporal.PlainMonthDay.from({
23 era: "foobar",
24 eraYear: 1,
25 monthCode: "M01",
26 day: 1,
27 calendar: "hebrew",
28 });
29 TemporalHelpers.assertPlainMonthDay(resultHebrew, "M01", 1,
30 "era and eraYear are ignored for calendar not using eras (Hebrew)");
31 assert.sameValue(resultHebrew.calendarId, "hebrew");
32
33 reportCompare(0, 0);