js/src/tests/test262/language/expressions/super/call-spread-err-sngl-err-itr-step.js
raw symbols SCIP| 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/spread/sngl-err-itr-step.case |
| 3 | // - src/spread/error/super-call.template |
| 4 | /*--- |
| 5 | description: Spread operator applied to the only argument when IteratorStep fails (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 : ... AssignmentExpression |
| 22 | |
| 23 | 1. Let list be an empty List. |
| 24 | 2. Let spreadRef be the result of evaluating AssignmentExpression. |
| 25 | 3. Let spreadObj be GetValue(spreadRef). |
| 26 | 4. Let iterator be GetIterator(spreadObj). |
| 27 | 5. ReturnIfAbrupt(iterator). |
| 28 | 6. Repeat |
| 29 | a. Let next be IteratorStep(iterator). |
| 30 | b. ReturnIfAbrupt(next). |
| 31 | |
| 32 | 7.4.5 IteratorStep ( iterator ) |
| 33 | |
| 34 | 1. Let result be IteratorNext(iterator). |
| 35 | 2. ReturnIfAbrupt(result). |
| 36 | |
| 37 | 7.4.2 IteratorNext ( iterator, value ) |
| 38 | |
| 39 | 1. If value was not passed, then |
| 40 | a. Let result be Invoke(iterator, "next", « »). |
| 41 | [...] |
| 42 | 3. ReturnIfAbrupt(result). |
| 43 | ---*/ |
| 44 | var iter = {}; |
| 45 | iter[Symbol.iterator] = function() { |
| 46 | return { |
| 47 | next: function() { |
| 48 | throw new Test262Error(); |
| 49 | } |
| 50 | }; |
| 51 | }; |
| 52 | |
| 53 | class Test262ParentClass { |
| 54 | constructor() {} |
| 55 | } |
| 56 | |
| 57 | class Test262ChildClass extends Test262ParentClass { |
| 58 | constructor() { |
| 59 | super(...iter); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | assert.throws(Test262Error, function() { |
| 64 | new Test262ChildClass(); |
| 65 | }); |
| 66 | |
| 67 | reportCompare(0, 0); |