tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

argument-zoneddatetime.js (943B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-temporal.instant.from
      7 description: Fast path for converting Temporal.ZonedDateTime to Temporal.Instant
      8 info: |
      9    sec-temporal.instant.from step 2:
     10      2. Return ? ToTemporalInstant(_item_).
     11    sec-temporal-totemporalinstant step 1.b:
     12      b. If _item_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
     13        i. Return ! CreateTemporalInstant(_item_.[[Nanoseconds]]).
     14 includes: [compareArray.js, temporalHelpers.js]
     15 features: [Temporal]
     16 ---*/
     17 
     18 TemporalHelpers.checkToTemporalInstantFastPath((datetime) => {
     19  const result = Temporal.Instant.from(datetime);
     20  assert.sameValue(result.epochNanoseconds, result.epochNanoseconds, "epochNanoseconds result");
     21 });
     22 
     23 reportCompare(0, 0);