tor-browser

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

meth-dflt-params-duplicates.js (1944B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/dflt-params-duplicates.case
      4 // - src/function-forms/syntax/meth.template
      5 /*---
      6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (method)
      7 esid: sec-runtime-semantics-definemethod
      8 features: [default-parameters]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
     15 
     16    [...]
     17    6. Let closure be FunctionCreate(kind, StrictFormalParameters,
     18       FunctionBody, scope, strict). If functionPrototype was passed as a
     19       parameter then pass its value as the functionPrototype optional argument
     20       of FunctionCreate.
     21    [...]
     22 
     23    9.2.1 [[Call]] ( thisArgument, argumentsList)
     24 
     25    [...]
     26    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     27    [...]
     28 
     29    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     30 
     31    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     32    [...]
     33 
     34    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     35 
     36    [...]
     37    23. Let iteratorRecord be Record {[[iterator]]:
     38        CreateListIterator(argumentsList), [[done]]: false}.
     39    24. If hasDuplicates is true, then
     40        [...]
     41    25. Else,
     42        b. Let formalStatus be IteratorBindingInitialization for formals with
     43           iteratorRecord and env as arguments.
     44    [...]
     45 
     46    14.1.2 Static Semantics: Early Errors
     47 
     48    StrictFormalParameters : FormalParameters
     49 
     50    - It is a Syntax Error if BoundNames of FormalParameters contains any
     51      duplicate elements.
     52 
     53    FormalParameters : FormalParameterList
     54 
     55    - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
     56      false and BoundNames of FormalParameterList contains any duplicate
     57      elements.
     58 
     59 ---*/
     60 $DONOTEVALUATE();
     61 
     62 0, {
     63  method(x = 0, x) {
     64    
     65  }
     66 };