Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/dstr-async-gen-meth-ary-ptrn-rest-init-id.js

raw
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/async-gen-meth.template
4 /*---
5 description: Reset element (identifier) does not support initializer (async generator method)
6 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
7 features: [async-iteration]
8 flags: [generated, async]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 AsyncGeneratorMethod :
14 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
15 { AsyncGeneratorBody }
16
17 1. Let propKey be the result of evaluating PropertyName.
18 2. ReturnIfAbrupt(propKey).
19 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
20 Otherwise let strict be false.
21 4. Let scope be the running execution context's LexicalEnvironment.
22 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
23 AsyncGeneratorBody, scope, strict).
24 [...]
25
26
27 13.3.3 Destructuring Binding Patterns
28 ArrayBindingPattern[Yield] :
29 [ Elisionopt BindingRestElement[?Yield]opt ]
30 [ BindingElementList[?Yield] ]
31 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
32 ---*/
33 throw "Test262: This statement should not be evaluated.";
34
35
36 var callCount = 0;
37 var obj = {
38 async *method([...x = []]) {
39
40 callCount = callCount + 1;
41 }
42 };
43
44 obj.method([]).next().then(() => {
45 assert.sameValue(callCount, 1, 'invoked exactly once');
46 }).then($DONE, $DONE);