Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/dstr-meth-obj-ptrn-rest-getter.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/obj-ptrn-rest-getter.case
3 // - src/dstr-binding/default/meth.template
4 /*---
5 description: Getter is called when obj is being deconstructed to a rest Object (method)
6 esid: sec-runtime-semantics-definemethod
7 es6id: 14.3.8
8 features: [object-rest, destructuring-binding]
9 flags: [generated]
10 includes: [propertyHelper.js]
11 info: |
12 MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
13
14 [...]
15 6. Let closure be FunctionCreate(kind, StrictFormalParameters,
16 FunctionBody, scope, strict). If functionPrototype was passed as a
17 parameter then pass its value as the functionPrototype optional argument
18 of FunctionCreate.
19 [...]
20
21 9.2.1 [[Call]] ( thisArgument, argumentsList)
22
23 [...]
24 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
25 [...]
26
27 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
28
29 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
30 [...]
31
32 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
33
34 [...]
35 23. Let iteratorRecord be Record {[[iterator]]:
36 CreateListIterator(argumentsList), [[done]]: false}.
37 24. If hasDuplicates is true, then
38 [...]
39 25. Else,
40 b. Let formalStatus be IteratorBindingInitialization for formals with
41 iteratorRecord and env as arguments.
42 [...]
43 ---*/
44 var count = 0;
45
46 var callCount = 0;
47 var obj = {
48 method({...x}) {
49 assert.sameValue(count, 1);
50
51 verifyProperty(x, "v", {
52 enumerable: true,
53 writable: true,
54 configurable: true,
55 value: 2
56 });
57 callCount = callCount + 1;
58 }
59 };
60
61 obj.method({ get v() { count++; return 2; } });
62 assert.sameValue(callCount, 1, 'method invoked exactly once');