test262/test/built-ins/Temporal/PlainMonthDay/from/one-of-era-erayear-undefine...

16 lines
601 B
JavaScript

// 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.plainmonthday.from
description: Does not throw a RangeError if only one of era/eraYear fields is present
features: [Temporal]
includes: [temporalHelpers.js]
---*/
const base = { year: 2000, month: 5, day: 2, era: 'ce' };
TemporalHelpers.assertPlainMonthDay(Temporal.PlainMonthDay.from(base), 'M05', 2);
const base2 = { year: 2000, month: 5, day: 2, eraYear: 1 };
TemporalHelpers.assertPlainMonthDay(Temporal.PlainMonthDay.from(base2), 'M05', 2);