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 (1786B)


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