summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/with/cross-era-boundary.js
blob: d372a581cf4509bb7ed0217f144ac3780769fe52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plaindate.prototype.with
description: Behaviour when property bag forms a date out of bounds of the current era
features: [Temporal]
---*/

// Last day of Showa era
const instance = new Temporal.PlainDate(1989, 1, 7, "japanese");

const result1 = instance.with({ day: 10 });
assert.notSameValue(result1.era, instance.era, "resulting day should have crossed an era boundary");

const result2 = instance.with({ month: 2 });
assert.notSameValue(result2.era, instance.era, "resulting month should have crossed an era boundary");

reportCompare(0, 0);