| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/spread/obj-override-immutable.case |
| 3 |
// - src/spread/default/super-call.template |
| 4 |
/*--- |
| 5 |
description: Object Spread overriding immutable properties (SuperCall) |
| 6 |
esid: sec-super-keyword-runtime-semantics-evaluation |
| 7 |
es6id: 12.3.5.1 |
| 8 |
features: [object-spread] |
| 9 |
flags: [generated] |
| 10 |
includes: [propertyHelper.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 |
|
| 22 |
let o = {b: 2}; |
| 23 |
Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true}); |
| 24 |
|
| 25 |
|
| 26 |
var callCount = 0; |
| 27 |
|
| 28 |
class Test262ParentClass { |
| 29 |
constructor(obj) { |
| 30 |
assert.sameValue(obj.a, 3) |
| 31 |
assert.sameValue(obj.b, 2); |
| 32 |
|
| 33 |
verifyProperty(obj, "a", { |
| 34 |
enumerable: true, |
| 35 |
writable: true, |
| 36 |
configurable: true, |
| 37 |
value: 3 |
| 38 |
}); |
| 39 |
|
| 40 |
verifyProperty(obj, "b", { |
| 41 |
enumerable: true, |
| 42 |
writable: true, |
| 43 |
configurable: true, |
| 44 |
value: 2 |
| 45 |
}); |
| 46 |
callCount += 1; |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
class Test262ChildClass extends Test262ParentClass { |
| 51 |
constructor() { |
| 52 |
super({...o, a: 3}); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
new Test262ChildClass(); |
| 57 |
assert.sameValue(callCount, 1); |