tor-browser

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

await-using.js (827B)


      1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) module -- 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-let-const-using-and-await-using-declarations
      7 description: >
      8    module and block scope await using
      9 flags: [module]
     10 features: [explicit-resource-management]
     11 ---*/
     12 
     13 await using z = null;
     14 
     15 // Block local
     16 {
     17  await using z = undefined;
     18 }
     19 
     20 assert.sameValue(z, null);
     21 
     22 if (true) {
     23  const obj = { [Symbol.dispose]() { } };
     24  await using z = obj;
     25  assert.sameValue(z, obj);
     26 }
     27 
     28 
     29 reportCompare(0, 0);