summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js
new file mode 100644
index 0000000000..25e5499b48
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/id/custom-calendar.js
@@ -0,0 +1,26 @@
+// |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-get-temporal.calendar.prototype.id
+description: Getter does not call toString(), returns the ID from internal slot
+includes: [compareArray.js, temporalHelpers.js]
+features: [Temporal]
+---*/
+
+const actual = [];
+const expected = [];
+
+const calendar = new Temporal.Calendar("iso8601");
+TemporalHelpers.observeProperty(actual, calendar, Symbol.toPrimitive, undefined);
+TemporalHelpers.observeProperty(actual, calendar, "toString", function () {
+ actual.push("call calendar.toString");
+ return "calendar ID";
+});
+
+const result = calendar.id;
+assert.compareArray(actual, expected);
+assert.sameValue(result, "iso8601");
+
+reportCompare(0, 0);