Source code
Revision control
Copy as Markdown
Other Tools
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// 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.instant.from
description: Fast path for converting Temporal.ZonedDateTime to Temporal.Instant
info: |
sec-temporal.instant.from step 2:
2. Return ? ToTemporalInstant(_item_).
sec-temporal-totemporalinstant step 1.b:
b. If _item_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
i. Return ! CreateTemporalInstant(_item_.[[Nanoseconds]]).
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
---*/
TemporalHelpers.checkToTemporalInstantFastPath((datetime) => {
const result = Temporal.Instant.from(datetime);
assert.sameValue(result.epochNanoseconds, result.epochNanoseconds, "epochNanoseconds result");
});
reportCompare(0, 0);