tests/auto/qml/ecmascripttests/test262/test/language/expressions/class/dstr-gen-meth-static-dflt-ary-ptrn-rest-init-id.js
raw symbols SCIP| 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/dstr-binding/ary-ptrn-rest-init-id.case |
| 3 | // - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template |
| 4 | /*--- |
| 5 | description: Reset element (identifier) does not support initializer (static class expression generator method (default parameter)) |
| 6 | esid: sec-class-definitions-runtime-semantics-evaluation |
| 7 | es6id: 14.5.16 |
| 8 | features: [generators, destructuring-binding, default-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 |
| 28 | for m with arguments F and false. |
| 29 | [...] |
| 30 | |
| 31 | 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation |
| 32 | |
| 33 | GeneratorMethod : |
| 34 | * PropertyName ( StrictFormalParameters ) { GeneratorBody } |
| 35 | |
| 36 | 1. Let propKey be the result of evaluating PropertyName. |
| 37 | 2. ReturnIfAbrupt(propKey). |
| 38 | 3. If the function code for this GeneratorMethod is strict mode code, |
| 39 | let strict be true. Otherwise let strict be false. |
| 40 | 4. Let scope be the running execution context's LexicalEnvironment. |
| 41 | 5. Let closure be GeneratorFunctionCreate(Method, |
| 42 | StrictFormalParameters, GeneratorBody, scope, strict). |
| 43 | |
| 44 | 9.2.1 [[Call]] ( thisArgument, argumentsList) |
| 45 | |
| 46 | [...] |
| 47 | 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). |
| 48 | [...] |
| 49 | |
| 50 | 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) |
| 51 | |
| 52 | 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). |
| 53 | [...] |
| 54 | |
| 55 | 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) |
| 56 | |
| 57 | [...] |
| 58 | 23. Let iteratorRecord be Record {[[iterator]]: |
| 59 | CreateListIterator(argumentsList), [[done]]: false}. |
| 60 | 24. If hasDuplicates is true, then |
| 61 | [...] |
| 62 | 25. Else, |
| 63 | b. Let formalStatus be IteratorBindingInitialization for formals with |
| 64 | iteratorRecord and env as arguments. |
| 65 | [...] |
| 66 | |
| 67 | 13.3.3 Destructuring Binding Patterns |
| 68 | ArrayBindingPattern[Yield] : |
| 69 | [ Elisionopt BindingRestElement[?Yield]opt ] |
| 70 | [ BindingElementList[?Yield] ] |
| 71 | [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] |
| 72 | ---*/ |
| 73 | throw "Test262: This statement should not be evaluated."; |
| 74 | |
| 75 | var callCount = 0; |
| 76 | var C = class { |
| 77 | static *method([...x = []] = []) { |
| 78 | |
| 79 | callCount = callCount + 1; |
| 80 | } |
| 81 | }; |
| 82 | |
| 83 | C.method().next(); |
| 84 | assert.sameValue(callCount, 1, 'method invoked exactly once'); |