Debian Codegraph @

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

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/obj-skip-non-enumerable.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Object Spread doesn't copy non-enumerable properties (SuperCall)
6 esid: sec-super-keyword-runtime-semantics-evaluation
7 es6id: 12.3.5.1
8 features: [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
21 let o = {};
22 Object.defineProperty(o, "b", {value: 3, enumerable: false});
23
24
25 var callCount = 0;
26
27 class Test262ParentClass {
28 constructor(obj) {
29 assert.sameValue(obj.hasOwnProperty("b"), false)
30 assert.sameValue(Object.keys(obj).length, 0);
31 callCount += 1;
32 }
33 }
34
35 class Test262ChildClass extends Test262ParentClass {
36 constructor() {
37 super({...o});
38 }
39 }
40
41 new Test262ChildClass();
42 assert.sameValue(callCount, 1);