tor-browser

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

object-destructuring-param-strict-body.js (5285B)


      1 // |reftest| error:SyntaxError
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/object-destructuring-param-strict-body.case
      4 // - src/function-forms/syntax/func-decl.template
      5 /*---
      6 description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (function declaration)
      7 esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
      8 features: [rest-parameters]
      9 flags: [generated]
     10 negative:
     11  phase: parse
     12  type: SyntaxError
     13 info: |
     14    FunctionDeclaration :
     15        function BindingIdentifier ( FormalParameters ) { FunctionBody }
     16 
     17        [...]
     18        3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
     19           scope, strict).
     20        [...]
     21 
     22    9.2.1 [[Call]] ( thisArgument, argumentsList)
     23 
     24    [...]
     25    7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
     26    [...]
     27 
     28    9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
     29 
     30    1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
     31    [...]
     32 
     33    9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
     34 
     35    [...]
     36    23. Let iteratorRecord be Record {[[iterator]]:
     37        CreateListIterator(argumentsList), [[done]]: false}.
     38    24. If hasDuplicates is true, then
     39        [...]
     40    25. Else,
     41        b. Let formalStatus be IteratorBindingInitialization for formals with
     42           iteratorRecord and env as arguments.
     43    [...]
     44 
     45    13.3.3.4 Static Semantics: IsSimpleParameterList
     46 
     47    BindingElement : BindingPattern
     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 function f({property}) {
    133  "use strict";
    134 }