Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/statements/class/dstr-async-gen-meth-ary-ptrn-rest-not-final-ary.js

raw symbols SCIP
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
3 // - src/dstr-binding/default/cls-decl-async-gen-meth.template
4 /*---
5 description: Rest element (array binding pattern) may not be followed by any element (class expression method)
6 esid: sec-class-definitions-runtime-semantics-evaluation
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 i. Let status be the result of performing
25 PropertyDefinitionEvaluation for m with arguments proto and
26 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 async *method([...[x], y]) {
57
58 callCount = callCount + 1;
59 }
60 };
61
62 new C().method([1, 2, 3]).next().then(() => {
63 assert.sameValue(callCount, 1, 'invoked exactly once');
64 }).then($DONE, $DONE);