tor-browser

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

early-errors-object-async-method-duplicate-parameters.js (789B)


      1 // |reftest| error:SyntaxError
      2 // Copyright 2016 Microsoft, Inc. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 author: Brian Terlson <brian.terlson@microsoft.com>
      7 esid: sec-async-function-definitions
      8 description: Formal parameters may not contain duplicates
      9 info: |
     10  # 14.7 Async Function Definitions
     11 
     12   AsyncMethod[Yield, Await]:
     13     async[no LineTerminator here]PropertyName[?Yield, ?Await](UniqueFormalParameters[~Yield, +Await]){AsyncFunctionBody}
     14 
     15  # 14.1.2 Static Semantics: Early Errors
     16 
     17  UniqueFormalParameters:FormalParameters
     18 
     19  - It is a Syntax Error if BoundNames of FormalParameters contains any
     20    duplicate elements.
     21 negative:
     22  phase: parse
     23  type: SyntaxError
     24 ---*/
     25 
     26 $DONOTEVALUATE();
     27 ({
     28  async foo(a, a) { }
     29 })