tests/auto/qml/ecmascripttests/test262/test/language/statements/class/dstr-async-gen-meth-static-dflt-ary-ptrn-rest-not-final-id.js
raw symbols SCIP| 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/dstr-binding/ary-ptrn-rest-not-final-id.case |
| 3 | // - src/dstr-binding/default/cls-decl-async-gen-meth-static-dflt.template |
| 4 | /*--- |
| 5 | description: Rest element (identifier) may not be followed by any element (static class expression async generator method (default parameter)) |
| 6 | esid: sec-runtime-semantics-bindingclassdeclarationevaluation |
| 7 | features: [async-iteration] |
| 8 | flags: [generated, async] |
| 9 | negative: |
| 10 | phase: parse |
| 11 | type: SyntaxError |
| 12 | info: | |
| 13 | ClassDeclaration : class BindingIdentifier ClassTail |
| 14 | |
| 15 | 1. Let className be StringValue of BindingIdentifier. |
| 16 | 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with |
| 17 | argument className. |
| 18 | [...] |
| 19 | |
| 20 | 14.5.14 Runtime Semantics: ClassDefinitionEvaluation |
| 21 | |
| 22 | 21. For each ClassElement m in order from methods |
| 23 | a. If IsStatic of m is false, then |
| 24 | b. Else, |
| 25 | Let status be the result of performing PropertyDefinitionEvaluation for |
| 26 | m with arguments F and false. |
| 27 | [...] |
| 28 | |
| 29 | Runtime Semantics: PropertyDefinitionEvaluation |
| 30 | |
| 31 | AsyncGeneratorMethod : |
| 32 | async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) |
| 33 | { AsyncGeneratorBody } |
| 34 | |
| 35 | 1. Let propKey be the result of evaluating PropertyName. |
| 36 | 2. ReturnIfAbrupt(propKey). |
| 37 | 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. |
| 38 | Otherwise let strict be false. |
| 39 | 4. Let scope be the running execution context's LexicalEnvironment. |
| 40 | 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, |
| 41 | AsyncGeneratorBody, scope, strict). |
| 42 | [...] |
| 43 | |
| 44 | |
| 45 | 13.3.3 Destructuring Binding Patterns |
| 46 | ArrayBindingPattern[Yield] : |
| 47 | [ Elisionopt BindingRestElement[?Yield]opt ] |
| 48 | [ BindingElementList[?Yield] ] |
| 49 | [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] |
| 50 | ---*/ |
| 51 | throw "Test262: This statement should not be evaluated."; |
| 52 | |
| 53 | |
| 54 | var callCount = 0; |
| 55 | class C { |
| 56 | static async *method([...x, y] = [1, 2, 3]) { |
| 57 | |
| 58 | callCount = callCount + 1; |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | C.method().next().then(() => { |
| 63 | assert.sameValue(callCount, 1, 'invoked exactly once'); |
| 64 | }).then($DONE, $DONE); |