Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/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 es6id: 12.3.5.1
8 features: [object-spread]
9 flags: [generated]
10 includes: [propertyHelper.js]
11 info: |
12 SuperCall : super Arguments
13
14 1. Let newTarget be GetNewTarget().
15 2. If newTarget is undefined, throw a ReferenceError exception.
16 3. Let func be GetSuperConstructor().
17 4. ReturnIfAbrupt(func).
18 5. Let argList be ArgumentListEvaluation of Arguments.
19 [...]
20
21 Pending Runtime Semantics: PropertyDefinitionEvaluation
22
23 PropertyDefinition:...AssignmentExpression
24
25 1. Let exprValue be the result of evaluating AssignmentExpression.
26 2. Let fromValue be GetValue(exprValue).
27 3. ReturnIfAbrupt(fromValue).
28 4. Let excludedNames be a new empty List.
29 5. Return CopyDataProperties(object, fromValue, excludedNames).
30
31 ---*/
32 let o = {
33 get a() {
34 return 42;
35 }
36 };
37
38
39 var callCount = 0;
40
41 class Test262ParentClass {
42 constructor(obj) {
43 assert.sameValue(obj.c, 4);
44 assert.sameValue(obj.d, 5);
45 assert.sameValue(Object.keys(obj).length, 3);
46
47 verifyProperty(obj, "a", {
48 enumerable: true,
49 writable: true,
50 configurable: true,
51 value: 42
52 });
53 callCount += 1;
54 }
55 }
56
57 class Test262ChildClass extends Test262ParentClass {
58 constructor() {
59 super({...o, c: 4, d: 5});
60 }
61 }
62
63 new Test262ChildClass();
64 assert.sameValue(callCount, 1);