tor-browser

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

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


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