Debian Codegraph @

js/src/tests/test262/language/expressions/super/call-spread-sngl-obj-ident.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/sngl-obj-ident.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Object Spread operator without other arguments (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 = {c: 3, d: 4};
32
33
34 var callCount = 0;
35
36 class Test262ParentClass {
37 constructor(obj) {
38 assert.sameValue(Object.keys(obj).length, 2);
39
40 verifyProperty(obj, "c", {
41 enumerable: true,
42 writable: true,
43 configurable: true,
44 value: 3
45 });
46
47 verifyProperty(obj, "d", {
48 enumerable: true,
49 writable: true,
50 configurable: true,
51 value: 4
52 });
53 callCount += 1;
54 }
55 }
56
57 class Test262ChildClass extends Test262ParentClass {
58 constructor() {
59 super({...o});
60 }
61 }
62
63 new Test262ChildClass();
64 assert.sameValue(callCount, 1);
65
66 reportCompare(0, 0);