tor-browser

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

gen-meth-dflt-params-duplicates.js (2185B)


      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/gen-meth.template
      5 /*---
      6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (generator method)
      7 esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
      8 features: [default-parameters, generators]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    GeneratorMethod :
     15        * PropertyName ( StrictFormalParameters ) { GeneratorBody }
     16 
     17    1. Let propKey be the result of evaluating PropertyName.
     18    2. ReturnIfAbrupt(propKey).
     19    3. If the function code for this GeneratorMethod is strict mode code,
     20       let strict be true. Otherwise let strict be false.
     21    4. Let scope be the running execution context's LexicalEnvironment.
     22    5. Let closure be GeneratorFunctionCreate(Method,
     23       StrictFormalParameters, GeneratorBody, scope, strict).
     24    [...]
     25 
     26    9.2.1 [[Call]] ( thisArgument, argumentsList)
     27 
     28    [...]
     29    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     30    [...]
     31 
     32    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     33 
     34    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     35    [...]
     36 
     37    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     38 
     39    [...]
     40    23. Let iteratorRecord be Record {[[iterator]]:
     41        CreateListIterator(argumentsList), [[done]]: false}.
     42    24. If hasDuplicates is true, then
     43        [...]
     44    25. Else,
     45        b. Let formalStatus be IteratorBindingInitialization for formals with
     46           iteratorRecord and env as arguments.
     47    [...]
     48 
     49 
     50    14.1.2 Static Semantics: Early Errors
     51 
     52    StrictFormalParameters : FormalParameters
     53 
     54    - It is a Syntax Error if BoundNames of FormalParameters contains any
     55      duplicate elements.
     56 
     57    FormalParameters : FormalParameterList
     58 
     59    - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
     60      false and BoundNames of FormalParameterList contains any duplicate
     61      elements.
     62 
     63 ---*/
     64 $DONOTEVALUATE();
     65 
     66 0, {
     67  *method(x = 0, x) {
     68    
     69  }
     70 };