tor-browser

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

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


      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/gen-meth.template
      5 /*---
      6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (generator method)
      7 esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
      8 features: [generators]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    GeneratorMethod :
     15        * PropertyName ( StrictFormalParameters ) { GeneratorBody }
     16 
     17    1. Let propKey be the result of evaluating PropertyName.
     18    2. ReturnIfAbrupt(propKey).
     19    3. If the function code for this GeneratorMethod is strict mode code,
     20       let strict be true. Otherwise let strict be false.
     21    4. Let scope be the running execution context's LexicalEnvironment.
     22    5. Let closure be GeneratorFunctionCreate(Method,
     23       StrictFormalParameters, GeneratorBody, scope, strict).
     24    [...]
     25 
     26    9.2.1 [[Call]] ( thisArgument, argumentsList)
     27 
     28    [...]
     29    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     30    [...]
     31 
     32    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     33 
     34    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     35    [...]
     36 
     37    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     38 
     39    [...]
     40    23. Let iteratorRecord be Record {[[iterator]]:
     41        CreateListIterator(argumentsList), [[done]]: false}.
     42    24. If hasDuplicates is true, then
     43        [...]
     44    25. Else,
     45        b. Let formalStatus be IteratorBindingInitialization for formals with
     46           iteratorRecord and env as arguments.
     47    [...]
     48 
     49 
     50    Trailing comma in the parameters list
     51 
     52    14.1 Function Definitions
     53 
     54    FormalParameters[Yield, Await] :
     55        [empty]
     56        FunctionRestParameter[?Yield, ?Await]
     57        FormalParameterList[?Yield, ?Await]
     58        FormalParameterList[?Yield, ?Await] ,
     59        FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
     60 ---*/
     61 $DONOTEVALUATE();
     62 
     63 0, {
     64  *method(...a,) {
     65    
     66  }
     67 };