tor-browser

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

is-a-constructor.js (1203B)


      1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) -- explicit-resource-management is not enabled unconditionally, requires shell-options
      2 // Copyright (C) 2023 Ron Buckton. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-ecmascript-standard-built-in-objects
      7 description: >
      8  The AsyncDisposableStack constructor implements [[Construct]]
      9 info: |
     10  IsConstructor ( argument )
     11 
     12  The abstract operation IsConstructor takes argument argument (an ECMAScript language value).
     13  It determines if argument is a function object with a [[Construct]] internal method.
     14  It performs the following steps when called:
     15 
     16  If Type(argument) is not Object, return false.
     17  If argument has a [[Construct]] internal method, return true.
     18  Return false.
     19 includes: [isConstructor.js]
     20 features: [explicit-resource-management, Reflect.construct]
     21 ---*/
     22 
     23 assert.sameValue(isConstructor(AsyncDisposableStack), true, 'isConstructor(AsyncDisposableStack) must return true');
     24 new AsyncDisposableStack();
     25 
     26 reportCompare(0, 0);