tor-browser

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

async-gen-meth-rest-params-trailing-comma-early-error.js (1511B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/rest-params-trailing-comma-early-error.case
      4 // - src/function-forms/syntax/async-gen-meth.template
      5 /*---
      6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async generator method)
      7 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
      8 features: [async-iteration]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    AsyncGeneratorMethod :
     15        async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
     16            { AsyncGeneratorBody }
     17 
     18    1. Let propKey be the result of evaluating PropertyName.
     19    2. ReturnIfAbrupt(propKey).
     20    3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
     21       Otherwise let strict be false.
     22    4. Let scope be the running execution context's LexicalEnvironment.
     23    5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
     24       AsyncGeneratorBody, scope, strict).
     25    [...]
     26 
     27 
     28    Trailing comma in the parameters list
     29 
     30    14.1 Function Definitions
     31 
     32    FormalParameters[Yield, Await] :
     33        [empty]
     34        FunctionRestParameter[?Yield, ?Await]
     35        FormalParameterList[?Yield, ?Await]
     36        FormalParameterList[?Yield, ?Await] ,
     37        FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
     38 ---*/
     39 $DONOTEVALUATE();
     40 
     41 0, {
     42  async *method(...a,) {
     43    
     44  }
     45 };