Source code
Revision control
Copy as Markdown
Other Tools
// |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.from
description: >
Throw a TypeError if only one of era/eraYear fields is present (for calendar
using eras)
features: [Temporal]
---*/
const base = { year: 2000, month: 5, day: 2, era: "ce", calendar: "gregory" };
assert.throws(TypeError, () => Temporal.PlainDate.from(base));
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1, calendar: "gregory" };
assert.throws(TypeError, () => Temporal.PlainDate.from(base2));
reportCompare(0, 0);