tor-browser

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

argument-propertybag-optional-properties.js (910B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2025 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.plaintime.compare
      7 description: >
      8  A property bag missing optional properties is equivalent to a property bag
      9  with all the optional properties having their default values
     10 features: [Temporal]
     11 ---*/
     12 
     13 const minimumProperties = {
     14  hour: 0,
     15 };
     16 const allProperties = {
     17  hour: 0,
     18  minute: 0,
     19  second: 0,
     20  millisecond: 0,
     21  microsecond: 0,
     22  nanosecond: 0,
     23 };
     24 const resultWithout = Temporal.PlainTime.compare(minimumProperties, minimumProperties);
     25 const resultWith = Temporal.PlainTime.compare(allProperties, allProperties);
     26 assert.sameValue(resultWithout, resultWith, "results should be the same with and without optional properties");
     27 
     28 reportCompare(0, 0);