summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js')
-rw-r--r--js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js
new file mode 100644
index 0000000000..a8bf0eb747
--- /dev/null
+++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/argument-object.js
@@ -0,0 +1,20 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.plainyearmonth.from
+description: An object argument
+includes: [temporalHelpers.js]
+features: [Temporal]
+---*/
+
+const monthDayItem = { calendar: "gregory", era: "ce", eraYear: 2019, month: 11, get day() { throw new Test262Error("should not read the day property") } };
+TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from(monthDayItem),
+ 2019, 11, "M11", "month with day", "ce", 2019);
+
+const monthCodeDayItem = { calendar: "gregory", era: "ce", eraYear: 2019, monthCode: "M11", get day() { throw new Test262Error("should not read the day property") } };
+TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from(monthCodeDayItem),
+ 2019, 11, "M11", "monthCode with day", "ce", 2019);
+
+reportCompare(0, 0);