blob: a69dd0334152f0a44c937942ef1871633eb211e1 [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.timezone.prototype.getoffsetnanosecondsfor
description: Fast path for converting Temporal.ZonedDateTime to Temporal.Instant
info: |
sec-temporal.timezone.prototype.getoffsetnanosecondsfor step 3:
3. Set _instant_ to ? ToTemporalInstant(_instant_).
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 timeZone = Temporal.TimeZone.from("UTC");
const result = timeZone.getOffsetNanosecondsFor(datetime);
assert.sameValue(result, 0, "offset result");
});