Debian Codegraph @

js/src/tests/test262/language/statements/async-generator/dstr/ary-ptrn-rest-not-final-id.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/dstr-binding/ary-ptrn-rest-not-final-id.case
4 // - src/dstr-binding/default/async-gen-func-decl.template
5 /*---
6 description: Rest element (identifier) may not be followed by any element (async generator function declaration)
7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
8 features: [async-iteration]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
15 ( FormalParameters ) { AsyncGeneratorBody }
16
17 [...]
18 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
19 scope, strict).
20 [...]
21
22
23 13.3.3 Destructuring Binding Patterns
24 ArrayBindingPattern[Yield] :
25 [ Elisionopt BindingRestElement[?Yield]opt ]
26 [ BindingElementList[?Yield] ]
27 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
28 ---*/
29 $DONOTEVALUATE();
30
31
32 var callCount = 0;
33 async function* f([...x, y]) {
34
35 callCount = callCount + 1;
36 };
37 f([1, 2, 3]).next().then(() => {
38 assert.sameValue(callCount, 1, 'invoked exactly once');
39 }).then($DONE, $DONE);