tor-browser

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

dflt-params-duplicates.js (2662B)


      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/cls-expr-meth.template
      5 /*---
      6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (class expression method)
      7 esid: sec-class-definitions-runtime-semantics-evaluation
      8 features: [default-parameters]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    ClassExpression : class BindingIdentifieropt ClassTail
     15 
     16    1. If BindingIdentifieropt is not present, let className be undefined.
     17    2. Else, let className be StringValue of BindingIdentifier.
     18    3. Let value be the result of ClassDefinitionEvaluation of ClassTail
     19       with argument className.
     20    [...]
     21 
     22    14.5.14 Runtime Semantics: ClassDefinitionEvaluation
     23 
     24    21. For each ClassElement m in order from methods
     25        a. If IsStatic of m is false, then
     26           i. Let status be the result of performing
     27              PropertyDefinitionEvaluation for m with arguments proto and
     28              false.
     29        [...]
     30 
     31    14.3.8 Runtime Semantics: DefineMethod
     32 
     33    MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
     34 
     35    [...]
     36    6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
     37       scope, strict). If functionPrototype was passed as a parameter then pass its
     38       value as the functionPrototype optional argument of FunctionCreate.
     39    [...]
     40 
     41    9.2.1 [[Call]] ( thisArgument, argumentsList)
     42 
     43    [...]
     44    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     45    [...]
     46 
     47    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     48 
     49    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     50    [...]
     51 
     52    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     53 
     54    [...]
     55    23. Let iteratorRecord be Record {[[iterator]]:
     56        CreateListIterator(argumentsList), [[done]]: false}.
     57    24. If hasDuplicates is true, then
     58        [...]
     59    25. Else,
     60        b. Let formalStatus be IteratorBindingInitialization for formals with
     61           iteratorRecord and env as arguments.
     62    [...]
     63 
     64    14.1.2 Static Semantics: Early Errors
     65 
     66    StrictFormalParameters : FormalParameters
     67 
     68    - It is a Syntax Error if BoundNames of FormalParameters contains any
     69      duplicate elements.
     70 
     71    FormalParameters : FormalParameterList
     72 
     73    - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
     74      false and BoundNames of FormalParameterList contains any duplicate
     75      elements.
     76 
     77 ---*/
     78 $DONOTEVALUATE();
     79 
     80 0, class {
     81  method(x = 0, x) {
     82    
     83  }
     84 };