summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js
new file mode 100644
index 0000000000..720ab148ac
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-plainmonthday.js
@@ -0,0 +1,30 @@
+// |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.plainmonthday.from
+description: A PlainMonthDay object is copied, not returned directly
+includes: [temporalHelpers.js]
+features: [Temporal]
+---*/
+
+const orig = new Temporal.PlainMonthDay(5, 2, undefined, 2000);
+const result = Temporal.PlainMonthDay.from(orig);
+
+TemporalHelpers.assertPlainMonthDay(
+ result,
+ "M05", 2,
+ "PlainMonthDay is copied",
+ /* isoYear = */ 2000
+);
+
+assert.sameValue(result.getISOFields().calendar, orig.getISOFields().calendar, "Calendar is copied");
+
+assert.notSameValue(
+ result,
+ orig,
+ "When a PlainMonthDay is given, the returned value is not the original PlainMonthDay"
+);
+
+reportCompare(0, 0);