tor-browser

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

dflt-params-duplicates.js (2860B)


      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-gen-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, generators]
      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.4.13 Runtime Semantics: PropertyDefinitionEvaluation
     32 
     33    GeneratorMethod :
     34        * PropertyName ( StrictFormalParameters ) { GeneratorBody }
     35 
     36    1. Let propKey be the result of evaluating PropertyName.
     37    2. ReturnIfAbrupt(propKey).
     38    3. If the function code for this GeneratorMethod is strict mode code,
     39       let strict be true. Otherwise let strict be false.
     40    4. Let scope be the running execution context's LexicalEnvironment.
     41    5. Let closure be GeneratorFunctionCreate(Method,
     42       StrictFormalParameters, GeneratorBody, scope, strict).
     43 
     44    9.2.1 [[Call]] ( thisArgument, argumentsList)
     45 
     46    [...]
     47    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     48    [...]
     49 
     50    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     51 
     52    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     53    [...]
     54 
     55    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     56 
     57    [...]
     58    23. Let iteratorRecord be Record {[[iterator]]:
     59        CreateListIterator(argumentsList), [[done]]: false}.
     60    24. If hasDuplicates is true, then
     61        [...]
     62    25. Else,
     63        b. Let formalStatus be IteratorBindingInitialization for formals with
     64           iteratorRecord and env as arguments.
     65    [...]
     66 
     67 
     68    14.1.2 Static Semantics: Early Errors
     69 
     70    StrictFormalParameters : FormalParameters
     71 
     72    - It is a Syntax Error if BoundNames of FormalParameters contains any
     73      duplicate elements.
     74 
     75    FormalParameters : FormalParameterList
     76 
     77    - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
     78      false and BoundNames of FormalParameterList contains any duplicate
     79      elements.
     80 
     81 ---*/
     82 $DONOTEVALUATE();
     83 
     84 0, class {
     85  *method(x = 0, x) {
     86    
     87  }
     88 };