call-spread-sngl-empty.js (1401B)
1 // This file was procedurally generated from the following sources: 2 // - src/spread/sngl-empty.case 3 // - src/spread/default/super-call.template 4 /*--- 5 description: Spread operator applied to the only argument when no iteration occurs (SuperCall) 6 esid: sec-super-keyword-runtime-semantics-evaluation 7 flags: [generated] 8 info: | 9 SuperCall : super Arguments 10 11 1. Let newTarget be GetNewTarget(). 12 2. If newTarget is undefined, throw a ReferenceError exception. 13 3. Let func be GetSuperConstructor(). 14 4. ReturnIfAbrupt(func). 15 5. Let argList be ArgumentListEvaluation of Arguments. 16 [...] 17 18 12.3.6.1 Runtime Semantics: ArgumentListEvaluation 19 20 ArgumentList : ... AssignmentExpression 21 22 1. Let list be an empty List. 23 2. Let spreadRef be the result of evaluating AssignmentExpression. 24 3. Let spreadObj be GetValue(spreadRef). 25 4. Let iterator be GetIterator(spreadObj). 26 5. ReturnIfAbrupt(iterator). 27 6. Repeat 28 a. Let next be IteratorStep(iterator). 29 b. ReturnIfAbrupt(next). 30 c. If next is false, return list. 31 [...] 32 ---*/ 33 34 var callCount = 0; 35 36 class Test262ParentClass { 37 constructor() { 38 assert.sameValue(arguments.length, 0); 39 callCount += 1; 40 } 41 } 42 43 class Test262ChildClass extends Test262ParentClass { 44 constructor() { 45 super(...[]); 46 } 47 } 48 49 new Test262ChildClass(); 50 assert.sameValue(callCount, 1); 51 52 reportCompare(0, 0);