Debian Codegraph @

js/src/tests/test262/language/statements/async-generator/dstr/obj-ptrn-rest-skip-non-enumerable.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
4 // - src/dstr-binding/default/async-gen-func-decl.template
5 /*---
6 description: Rest object doesn't contain non-enumerable properties (async generator function declaration)
7 esid: sec-asyncgenerator-definitions-instantiatefunctionobject
8 features: [object-rest, async-iteration]
9 flags: [generated, async]
10 includes: [propertyHelper.js]
11 info: |
12 AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
13 ( FormalParameters ) { AsyncGeneratorBody }
14
15 [...]
16 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
17 scope, strict).
18 [...]
19
20 ---*/
21 var o = {a: 3, b: 4};
22 Object.defineProperty(o, "x", { value: 4, enumerable: false });
23
24
25 var callCount = 0;
26 async function* f({...rest}) {
27 assert.sameValue(rest.x, undefined);
28
29 verifyProperty(rest, "a", {
30 enumerable: true,
31 writable: true,
32 configurable: true,
33 value: 3
34 });
35
36 verifyProperty(rest, "b", {
37 enumerable: true,
38 writable: true,
39 configurable: true,
40 value: 4
41 });
42 callCount = callCount + 1;
43 };
44 f(o).next().then(() => {
45 assert.sameValue(callCount, 1, 'invoked exactly once');
46 }).then($DONE, $DONE);