tor-browser

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

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


      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/meth.template
      5 /*---
      6 description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (method)
      7 esid: sec-runtime-semantics-definemethod
      8 flags: [generated]
      9 negative:
     10  phase: parse
     11  type: SyntaxError
     12 info: |
     13    MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
     14 
     15    [...]
     16    6. Let closure be FunctionCreate(kind, StrictFormalParameters,
     17       FunctionBody, scope, strict). If functionPrototype was passed as a
     18       parameter then pass its value as the functionPrototype optional argument
     19       of FunctionCreate.
     20    [...]
     21 
     22    9.2.1 [[Call]] ( thisArgument, argumentsList)
     23 
     24    [...]
     25    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     26    [...]
     27 
     28    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     29 
     30    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     31    [...]
     32 
     33    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     34 
     35    [...]
     36    23. Let iteratorRecord be Record {[[iterator]]:
     37        CreateListIterator(argumentsList), [[done]]: false}.
     38    24. If hasDuplicates is true, then
     39        [...]
     40    25. Else,
     41        b. Let formalStatus be IteratorBindingInitialization for formals with
     42           iteratorRecord and env as arguments.
     43    [...]
     44 
     45    Trailing comma in the parameters list
     46 
     47    14.1 Function Definitions
     48 
     49    FormalParameters[Yield, Await] :
     50        [empty]
     51        FunctionRestParameter[?Yield, ?Await]
     52        FormalParameterList[?Yield, ?Await]
     53        FormalParameterList[?Yield, ?Await] ,
     54        FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
     55 ---*/
     56 $DONOTEVALUATE();
     57 
     58 0, {
     59  method(...a,) {
     60    
     61  }
     62 };