Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/obj-spread-order.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Spread operation follows [[OwnPropertyKeys]] order (SuperCall)
6 esid: sec-super-keyword-runtime-semantics-evaluation
7 es6id: 12.3.5.1
8 features: [Symbol, object-spread]
9 flags: [generated]
10 includes: [compareArray.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 var calls = [];
33 var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
34 Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
35 Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
36
37
38 var callCount = 0;
39
40 class Test262ParentClass {
41 constructor(obj) {
42 assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
43 assert.sameValue(Object.keys(obj).length, 3);
44 callCount += 1;
45 }
46 }
47
48 class Test262ChildClass extends Test262ParentClass {
49 constructor() {
50 super({...o});
51 }
52 }
53
54 new Test262ChildClass();
55 assert.sameValue(callCount, 1);