tor-browser

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

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


      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/gen-func-expr.template
      5 /*---
      6 description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (generator function expression)
      7 esid: sec-generator-function-definitions-runtime-semantics-evaluation
      8 features: [rest-parameters, generators]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
     15 
     16        [...]
     17        3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
     18           GeneratorBody, scope, strict).
     19        [...]
     20 
     21    9.2.1 [[Call]] ( thisArgument, argumentsList)
     22 
     23    [...]
     24    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     25    [...]
     26 
     27    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     28 
     29    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     30    [...]
     31 
     32    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     33 
     34    [...]
     35    23. Let iteratorRecord be Record {[[iterator]]:
     36        CreateListIterator(argumentsList), [[done]]: false}.
     37    24. If hasDuplicates is true, then
     38        [...]
     39    25. Else,
     40        b. Let formalStatus be IteratorBindingInitialization for formals with
     41           iteratorRecord and env as arguments.
     42    [...]
     43 
     44 
     45    14.1.13 Static Semantics: IsSimpleParameterList
     46 
     47    FormalParameters : FormalParameterList , FunctionRestParameter
     48 
     49    1. Return false.
     50 
     51    14.1.2 Static Semantics: Early Errors
     52 
     53    FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
     54    FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
     55    FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
     56 
     57    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     58      IsSimpleParameterList of FormalParameters is false.
     59 
     60    14.2.1 Static Semantics: Early Errors
     61 
     62    ArrowFunction : ArrowParameters => ConciseBody
     63 
     64    - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
     65      IsSimpleParameterList of ArrowParameters is false.
     66 
     67    14.3.1 Static Semantics: Early Errors
     68 
     69    MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
     70 
     71    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     72      IsSimpleParameterList of UniqueFormalParameters is false.
     73 
     74    MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
     75 
     76    - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
     77      IsSimpleParameterList of PropertySetParameterList is false.
     78 
     79    14.4.1 Static Semantics: Early Errors
     80 
     81    GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
     82 
     83    - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
     84      IsSimpleParameterList of UniqueFormalParameters is false.
     85 
     86    GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
     87    GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
     88    GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
     89 
     90    - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
     91      IsSimpleParameterList of UniqueFormalParameters is false.
     92 
     93    14.5.1 Static Semantics: Early Errors
     94 
     95    AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
     96 
     97    - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
     98      IsSimpleParameterList of UniqueFormalParameters is false.
     99 
    100    AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
    101    AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
    102    AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
    103 
    104    - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
    105      IsSimpleParameterList of FormalParameters is false.
    106 
    107    14.7.1 Static Semantics: Early Errors
    108 
    109    AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
    110 
    111    - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
    112      IsSimpleParameterList of UniqueFormalParameters is false.
    113 
    114    AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
    115    AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
    116    AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
    117    AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
    118 
    119    - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
    120      IsSimpleParameterList of FormalParameters is false.
    121 
    122    14.8.1 Static Semantics: Early Errors
    123 
    124    AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
    125 
    126    - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
    127      IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
    128 
    129 ---*/
    130 $DONOTEVALUATE();
    131 
    132 0, function*(a,...rest) {
    133  "use strict";
    134 };