Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-generator/dstr-named-obj-ptrn-rest-skip-non-enumerable.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
3 // - src/dstr-binding/default/async-gen-func-named-expr.template
4 /*---
5 description: Rest object doesn't contain non-enumerable properties (async generator named function expression)
6 esid: sec-asyncgenerator-definitions-evaluation
7 features: [object-rest, async-iteration]
8 flags: [generated, async]
9 includes: [propertyHelper.js]
10 info: |
11 AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
12 ( FormalParameters ) { AsyncGeneratorBody }
13
14 [...]
15 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
16 AsyncGeneratorBody, funcEnv, strict).
17 [...]
18
19 ---*/
20 var o = {a: 3, b: 4};
21 Object.defineProperty(o, "x", { value: 4, enumerable: false });
22
23
24 var callCount = 0;
25 var f;
26 f = async function* h({...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
45 f(o).next().then(() => {
46 assert.sameValue(callCount, 1, 'invoked exactly once');
47 }).then($DONE, $DONE);