summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-cast.js
blob: b14f01000b08d51fea48ac24537aa0324a8f761d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |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.prototype.equals
description: equals() casts its argument
features: [Temporal]
---*/

const nov94 = Temporal.PlainYearMonth.from("1994-11");

assert.sameValue(nov94.equals({ year: 2013, month: 6 }), false, "object");
assert.sameValue(nov94.equals({ year: 1994, month: 11 }), true, "object");
assert.sameValue(nov94.equals("2013-06"), false, "string");
assert.sameValue(nov94.equals("1994-11"), true, "string");
assert.throws(TypeError, () => nov94.equals({ year: 2013 }), "missing property");

reportCompare(0, 0);