| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/spread/obj-manipulate-outter-obj-in-getter.case |
| 3 |
// - src/spread/default/super-call.template |
| 4 |
/*--- |
| 5 |
description: Getter manipulates outter object before it's spread operation (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 |
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 |
var o = { a: 0, b: 1 }; |
| 32 |
var cthulhu = { get x() { |
| 33 |
delete o.a; |
| 34 |
o.b = 42; |
| 35 |
o.c = "ni"; |
| 36 |
}}; |
| 37 |
|
| 38 |
var callCount = 0; |
| 39 |
|
| 40 |
class Test262ParentClass { |
| 41 |
constructor(obj) { |
| 42 |
assert.sameValue(obj.hasOwnProperty("a"), false); |
| 43 |
assert.sameValue(obj.b, 42); |
| 44 |
assert.sameValue(obj.c, "ni"); |
| 45 |
assert(obj.hasOwnProperty("x")); |
| 46 |
assert.sameValue(Object.keys(obj).length, 3); |
| 47 |
callCount += 1; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
class Test262ChildClass extends Test262ParentClass { |
| 52 |
constructor() { |
| 53 |
super({...cthulhu, ...o}); |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
new Test262ChildClass(); |
| 58 |
assert.sameValue(callCount, 1); |