Debian Codegraph @

js/src/tests/test262/language/expressions/super/call-spread-obj-getter-descriptor.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/obj-getter-descriptor.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Spread operation with getter results in data property descriptor (SuperCall)
6 esid: sec-super-keyword-runtime-semantics-evaluation
7 features: [object-spread]
8 flags: [generated]
9 includes: [propertyHelper.js]
10 info: |
11 SuperCall : super Arguments
12
13 1. Let newTarget be GetNewTarget().
14 2. If newTarget is undefined, throw a ReferenceError exception.
15 3. Let func be GetSuperConstructor().
16 4. ReturnIfAbrupt(func).
17 5. Let argList be ArgumentListEvaluation of Arguments.
18 [...]
19
20 Pending Runtime Semantics: PropertyDefinitionEvaluation
21
22 PropertyDefinition:...AssignmentExpression
23
24 1. Let exprValue be the result of evaluating AssignmentExpression.
25 2. Let fromValue be GetValue(exprValue).
26 3. ReturnIfAbrupt(fromValue).
27 4. Let excludedNames be a new empty List.
28 5. Return CopyDataProperties(object, fromValue, excludedNames).
29
30 ---*/
31 let o = {
32 get a() {
33 return 42;
34 }
35 };
36
37
38 var callCount = 0;
39
40 class Test262ParentClass {
41 constructor(obj) {
42 assert.sameValue(obj.c, 4);
43 assert.sameValue(obj.d, 5);
44 assert.sameValue(Object.keys(obj).length, 3);
45
46 verifyProperty(obj, "a", {
47 enumerable: true,
48 writable: true,
49 configurable: true,
50 value: 42
51 });
52 callCount += 1;
53 }
54 }
55
56 class Test262ChildClass extends Test262ParentClass {
57 constructor() {
58 super({...o, c: 4, d: 5});
59 }
60 }
61
62 new Test262ChildClass();
63 assert.sameValue(callCount, 1);
64
65 reportCompare(0, 0);