blob: 99fb2042778966c8756644602d4ca2b053fb72e9 [file] [log] [blame]
// 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");
});