Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/super/call-spread-obj-symbol-property.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/obj-symbol-property.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Spread operation where source object contains Symbol properties (SuperCall)
6 esid: sec-super-keyword-runtime-semantics-evaluation
7 es6id: 12.3.5.1
8 features: [Symbol, object-spread]
9 flags: [generated]
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 symbol = Symbol('foo');
32 let o = {};
33 o[symbol] = 1;
34
35
36 var callCount = 0;
37
38 class Test262ParentClass {
39 constructor(obj) {
40 assert.sameValue(obj[symbol], 1);
41 assert(Object.hasOwnProperty.call(obj, symbol));
42 assert.sameValue(obj.c, 4);
43 assert.sameValue(obj.d, 5);
44 assert.sameValue(Object.keys(obj).length, 2);
45 callCount += 1;
46 }
47 }
48
49 class Test262ChildClass extends Test262ParentClass {
50 constructor() {
51 super({...o, c: 4, d: 5});
52 }
53 }
54
55 new Test262ChildClass();
56 assert.sameValue(callCount, 1);