Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/dstr-meth-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/meth.template
4 /*---
5 description: Rest object doesn't contain non-enumerable properties (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 o = {a: 3, b: 4};
45 Object.defineProperty(o, "x", { value: 4, enumerable: false });
46
47 var callCount = 0;
48 var obj = {
49 method({...rest}) {
50 assert.sameValue(rest.x, undefined);
51
52 verifyProperty(rest, "a", {
53 enumerable: true,
54 writable: true,
55 configurable: true,
56 value: 3
57 });
58
59 verifyProperty(rest, "b", {
60 enumerable: true,
61 writable: true,
62 configurable: true,
63 value: 4
64 });
65 callCount = callCount + 1;
66 }
67 };
68
69 obj.method(o);
70 assert.sameValue(callCount, 1, 'method invoked exactly once');