mirror of https://github.com/tc39/test262.git
21 lines
1013 B
JavaScript
21 lines
1013 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: Fast path for converting other Temporal objects to Temporal.Calendar by reading internal slots
|
|
info: |
|
|
sec-temporal.calendar.from step 1:
|
|
1. Return ? ToTemporalCalendar(_item_).
|
|
sec-temporal-totemporalcalendar step 1.a:
|
|
a. If _temporalCalendarLike_ has an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], [[InitializedTemporalMonthDay]], [[InitializedTemporalYearMonth]], or [[InitializedTemporalZonedDateTime]] internal slot, then
|
|
i. Return _temporalCalendarLike_.[[Calendar]].
|
|
includes: [compareArray.js, temporalHelpers.js]
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => {
|
|
const newCalendar = Temporal.Calendar.from(temporalObject);
|
|
assert.sameValue(newCalendar, calendar, "calendar object retrieved from internal slot");
|
|
});
|