Debian Codegraph @

js/src/tests/test262/language/expressions/async-generator/dstr/obj-ptrn-prop-ary-trailing-comma.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
4 // - src/dstr-binding/default/async-gen-func-expr.template
5 /*---
6 description: Trailing comma is allowed following BindingPropertyList (async generator function expression)
7 esid: sec-asyncgenerator-definitions-evaluation
8 features: [async-iteration]
9 flags: [generated, async]
10 info: |
11 AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
12 AsyncGeneratorBody }
13
14 [...]
15 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
16 AsyncGeneratorBody, scope, strict).
17 [...]
18
19
20 13.3.3 Destructuring Binding Patterns
21
22 ObjectBindingPattern[Yield] :
23 { }
24 { BindingPropertyList[?Yield] }
25 { BindingPropertyList[?Yield] , }
26 ---*/
27
28
29 var callCount = 0;
30 var f;
31 f = async function*({ x: [y], }) {
32 assert.sameValue(y,45);
33 callCount = callCount + 1;
34 };
35
36 f({ x: [45] }).next().then(() => {
37 assert.sameValue(callCount, 1, 'invoked exactly once');
38 }).then($DONE, $DONE);