mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 11:08:49 +02:00
Checking whether an object implements the Calendar protocol is now done by means of HasProperty operations for each of the required methods unless the object already has the Calendar brand. Discussion: https://github.com/tc39/proposal-temporal/issues/2104#issuecomment-1409549753 Corresponding normative PR: https://github.com/tc39/proposal-temporal/pull/2485
36 lines
792 B
JavaScript
36 lines
792 B
JavaScript
// 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.calendar.from
|
|
description: >
|
|
Converting an object implementing the Calendar protocol to Temporal.Calendar
|
|
gives the same object
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const custom = {
|
|
dateAdd() {},
|
|
dateFromFields() {},
|
|
dateUntil() {},
|
|
day() {},
|
|
dayOfWeek() {},
|
|
dayOfYear() {},
|
|
daysInMonth() {},
|
|
daysInWeek() {},
|
|
daysInYear() {},
|
|
fields() {},
|
|
id: "custom-calendar",
|
|
inLeapYear() {},
|
|
mergeFields() {},
|
|
month() {},
|
|
monthCode() {},
|
|
monthDayFromFields() {},
|
|
monthsInYear() {},
|
|
weekOfYear() {},
|
|
year() {},
|
|
yearMonthFromFields() {},
|
|
yearOfWeek() {},
|
|
};
|
|
assert.sameValue(Temporal.Calendar.from(custom), custom);
|