Debian Codegraph @

js/src/tests/test262/language/statements/async-generator/dstr/obj-ptrn-prop-id-init.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/dstr-binding/obj-ptrn-prop-id-init.case
4 // - src/dstr-binding/default/async-gen-func-decl.template
5 /*---
6 description: Binding as specified via property name, identifier, and initializer (async generator function declaration)
7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
8 features: [async-iteration]
9 flags: [generated, async]
10 info: |
11 AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
12 ( FormalParameters ) { AsyncGeneratorBody }
13
14 [...]
15 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
16 scope, strict).
17 [...]
18
19
20 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
21
22 SingleNameBinding : BindingIdentifier Initializeropt
23
24 [...]
25 8. Return InitializeReferencedBinding(lhs, v).
26 ---*/
27
28
29 var callCount = 0;
30 async function* f({ x: y = 33 }) {
31 assert.sameValue(y, 33);
32 assert.throws(ReferenceError, function() {
33 x;
34 });
35 callCount = callCount + 1;
36 };
37 f({ }).next().then(() => {
38 assert.sameValue(callCount, 1, 'invoked exactly once');
39 }).then($DONE, $DONE);