call-spread-mult-obj-undefined.js (1421B)
1 // This file was procedurally generated from the following sources: 2 // - src/spread/mult-obj-undefined.case 3 // - src/spread/default/super-call.template 4 /*--- 5 description: Object Spread operator following other arguments with undefined (SuperCall) 6 esid: sec-super-keyword-runtime-semantics-evaluation 7 features: [object-spread] 8 flags: [generated] 9 info: | 10 SuperCall : super Arguments 11 12 1. Let newTarget be GetNewTarget(). 13 2. If newTarget is undefined, throw a ReferenceError exception. 14 3. Let func be GetSuperConstructor(). 15 4. ReturnIfAbrupt(func). 16 5. Let argList be ArgumentListEvaluation of Arguments. 17 [...] 18 19 Pending Runtime Semantics: PropertyDefinitionEvaluation 20 21 PropertyDefinition:...AssignmentExpression 22 23 1. Let exprValue be the result of evaluating AssignmentExpression. 24 2. Let fromValue be GetValue(exprValue). 25 3. ReturnIfAbrupt(fromValue). 26 4. Let excludedNames be a new empty List. 27 5. Return CopyDataProperties(object, fromValue, excludedNames). 28 29 ---*/ 30 31 var callCount = 0; 32 33 class Test262ParentClass { 34 constructor(obj) { 35 assert.sameValue(obj.a, 1); 36 assert.sameValue(obj.b, 2); 37 assert.sameValue(Object.keys(obj).length, 2); 38 callCount += 1; 39 } 40 } 41 42 class Test262ChildClass extends Test262ParentClass { 43 constructor() { 44 super({a: 1, b: 2, ...undefined}); 45 } 46 } 47 48 new Test262ChildClass(); 49 assert.sameValue(callCount, 1); 50 51 reportCompare(0, 0);