tor-browser

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

rest-param-strict-body.js (6094B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/rest-param-strict-body.case
      4 // - src/function-forms/syntax/cls-expr-meth-static.template
      5 /*---
      6 description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression method)
      7 esid: sec-class-definitions-runtime-semantics-evaluation
      8 features: [rest-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        b. Else,
     27           Let status be the result of performing PropertyDefinitionEvaluation for
     28           m with arguments F and 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.13 Static Semantics: IsSimpleParameterList
     65 
     66    FormalParameters : FormalParameterList , FunctionRestParameter
     67 
     68    1. Return false.
     69 
     70    14.1.2 Static Semantics: Early Errors
     71 
     72    FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
     73    FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
     74    FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
     75 
     76    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     77      IsSimpleParameterList of FormalParameters is false.
     78 
     79    14.2.1 Static Semantics: Early Errors
     80 
     81    ArrowFunction : ArrowParameters => ConciseBody
     82 
     83    - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
     84      IsSimpleParameterList of ArrowParameters is false.
     85 
     86    14.3.1 Static Semantics: Early Errors
     87 
     88    MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
     89 
     90    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     91      IsSimpleParameterList of UniqueFormalParameters is false.
     92 
     93    MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
     94 
     95    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     96      IsSimpleParameterList of PropertySetParameterList is false.
     97 
     98    14.4.1 Static Semantics: Early Errors
     99 
    100    GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
    101 
    102    - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
    103      IsSimpleParameterList of UniqueFormalParameters is false.
    104 
    105    GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
    106    GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
    107    GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
    108 
    109    - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
    110      IsSimpleParameterList of UniqueFormalParameters is false.
    111 
    112    14.5.1 Static Semantics: Early Errors
    113 
    114    AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
    115 
    116    - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
    117      IsSimpleParameterList of UniqueFormalParameters is false.
    118 
    119    AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
    120    AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
    121    AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
    122 
    123    - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
    124      IsSimpleParameterList of FormalParameters is false.
    125 
    126    14.7.1 Static Semantics: Early Errors
    127 
    128    AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
    129 
    130    - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
    131      IsSimpleParameterList of UniqueFormalParameters is false.
    132 
    133    AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
    134    AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
    135    AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
    136    AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
    137 
    138    - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
    139      IsSimpleParameterList of FormalParameters is false.
    140 
    141    14.8.1 Static Semantics: Early Errors
    142 
    143    AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
    144 
    145    - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
    146      IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
    147 
    148 ---*/
    149 $DONOTEVALUATE();
    150 
    151 0, class {
    152  static method(a,...rest) {
    153    "use strict";
    154  }
    155 };