tor-browser

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

array-destructuring-param-strict-body.js (5207B)


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