tor-browser

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

instant-string-sub-minute-offset.js (778B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2022 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.compare
      7 description: Temporal.Instant string with sub-minute offset
      8 features: [Temporal]
      9 ---*/
     10 
     11 const epoch = new Temporal.Instant(0n);
     12 const str = "1970-01-01T00:19:32.37+00:19:32.37";
     13 
     14 const result1 = Temporal.Instant.compare(str, epoch);
     15 assert.sameValue(result1, 0, "if present, sub-minute offset is accepted exactly (first argument)");
     16 
     17 const result2 = Temporal.Instant.compare(epoch, str);
     18 assert.sameValue(result2, 0, "if present, sub-minute offset is accepted exactly (second argument)");
     19 
     20 reportCompare(0, 0);