call-spread-err-mult-err-iter-get-value.js (1539B)
1 // This file was procedurally generated from the following sources: 2 // - src/spread/mult-err-iter-get-value.case 3 // - src/spread/error/super-call.template 4 /*--- 5 description: Spread operator following other arguments when GetIterator fails (@@iterator function return value) (SuperCall) 6 esid: sec-super-keyword-runtime-semantics-evaluation 7 features: [Symbol.iterator] 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 12.3.6.1 Runtime Semantics: ArgumentListEvaluation 20 21 ArgumentList : ArgumentList , ... AssignmentExpression 22 23 1. Let precedingArgs be the result of evaluating ArgumentList. 24 2. Let spreadRef be the result of evaluating AssignmentExpression. 25 3. Let iterator be GetIterator(GetValue(spreadRef) ). 26 4. ReturnIfAbrupt(iterator). 27 28 7.4.1 GetIterator ( obj, method ) 29 30 [...] 31 2. Let iterator be ? Call(method, obj). 32 3. If Type(iterator) is not Object, throw a TypeError exception. 33 ---*/ 34 var iter = {}; 35 Object.defineProperty(iter, Symbol.iterator, { 36 get: function() { 37 return null; 38 } 39 }); 40 41 class Test262ParentClass { 42 constructor() {} 43 } 44 45 class Test262ChildClass extends Test262ParentClass { 46 constructor() { 47 super(0, ...iter); 48 } 49 } 50 51 assert.throws(TypeError, function() { 52 new Test262ChildClass(); 53 }); 54 55 reportCompare(0, 0);