tor-browser

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

block-scope-syntax-await-using-declarations-mixed-with-without-initializer.js (1169B)


      1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) error:SyntaxError -- 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-and-const-declarations-static-semantics-early-errors
      7 description: >
      8    await using declarations mixed: with, without initializer
      9 info: |
     10    Static Semantics : Early Errors
     11      LexicalBinding : BindingIdentifier Initializer?
     12 
     13      - It is a Syntax Error if Initializer is not present and IsConstantDeclaration of the LexicalDeclaration containing
     14        this LexicalBinding is true.
     15 
     16    Static Semantics : IsConstantDeclaration
     17      AwaitUsingDeclaration :
     18        CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
     19 
     20      1. Return true.
     21 
     22 negative:
     23  phase: parse
     24  type: SyntaxError
     25 features: [explicit-resource-management]
     26 ---*/
     27 
     28 $DONOTEVALUATE();
     29 async function f() {
     30  await using x = null, y;
     31 }