tor-browser

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

not-a-constructor.js (953B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2021 the V8 project authors. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-temporal.now.timezoneid
      7 description: Temporal.Now.timeZoneId does not implement [[Construct]]
      8 info: |
      9  ECMAScript Function Objects
     10 
     11  Built-in function objects that are not identified as constructors do not
     12  implement the [[Construct]] internal method unless otherwise specified in
     13  the description of a particular function.
     14 includes: [isConstructor.js]
     15 features: [Reflect.construct, Temporal, arrow-function]
     16 ---*/
     17 
     18 assert.sameValue(isConstructor(Temporal.Now.timeZoneId), false, 'isConstructor(Temporal.Now.timeZoneId) must return false');
     19 
     20 assert.throws(TypeError, () => {
     21  new Temporal.Now.timeZoneId();
     22 }, 'new Temporal.Now.timeZoneId() throws a TypeError exception');
     23 
     24 reportCompare(0, 0);