mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 05:55:36 +02:00
Add test for invalid mixed cal
This commit is contained in:
parent
9c6ecf5326
commit
abf437c338
23
test/built-ins/Temporal/PlainYearMonth/prototype/since/mixed-calendar-invalid.js
vendored
Normal file
23
test/built-ins/Temporal/PlainYearMonth/prototype/since/mixed-calendar-invalid.js
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.plainyearmonth.prototype.since
|
||||||
|
description: Mixed calendars throw as invalid
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
class customCal extends Temporal.Calendar {
|
||||||
|
constructor () {
|
||||||
|
super('iso8601');
|
||||||
|
}
|
||||||
|
|
||||||
|
toString() {
|
||||||
|
return "I am a secret cal.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const ym1 = new Temporal.PlainYearMonth(2000, 1);
|
||||||
|
const ym2 = new Temporal.PlainYearMonth(2000, 1, new customCal());
|
||||||
|
|
||||||
|
assert.throws(RangeError, () => ym1.since(ym2), 'since throws with different calendars');
|
Loading…
x
Reference in New Issue
Block a user