Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/obj-with-overrides.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Object Spread properties being overriden (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 o = {a: 2, b: 3, c: 4, e: undefined, f: null, g: false};
32
33
34 var callCount = 0;
35
36 class Test262ParentClass {
37 constructor(obj) {
38 assert.sameValue(obj.a, 1);
39 assert.sameValue(obj.b, 7);
40 assert.sameValue(obj.c, 4);
41 assert.sameValue(obj.d, 5);
42 assert(obj.hasOwnProperty("e"));
43 assert.sameValue(obj.f, null);
44 assert.sameValue(obj.g, false);
45 assert.sameValue(obj.h, -0);
46 assert.sameValue(obj.i.toString(), "Symbol(foo)");
47 assert(Object.is(obj.j, o));
48 assert.sameValue(Object.keys(obj).length, 10);
49 callCount += 1;
50 }
51 }
52
53 class Test262ChildClass extends Test262ParentClass {
54 constructor() {
55 super({...o, a: 1, b: 7, d: 5, h: -0, i: Symbol("foo"), j: o});
56 }
57 }
58
59 new Test262ChildClass();
60 assert.sameValue(callCount, 1);