tor-browser

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

subclass.js (852B)


      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.plaintime
      7 description: Test for Temporal.PlainTime subclassing.
      8 includes: [temporalHelpers.js]
      9 features: [Temporal]
     10 ---*/
     11 
     12 class CustomPlainTime extends Temporal.PlainTime {
     13 }
     14 
     15 const instance = new CustomPlainTime(12, 34, 56, 987, 654, 321);
     16 TemporalHelpers.assertPlainTime(instance, 12, 34, 56, 987, 654, 321);
     17 assert.sameValue(Object.getPrototypeOf(instance), CustomPlainTime.prototype, "Instance of CustomPlainTime");
     18 assert(instance instanceof CustomPlainTime, "Instance of CustomPlainTime");
     19 assert(instance instanceof Temporal.PlainTime, "Instance of Temporal.PlainTime");
     20 
     21 reportCompare(0, 0);