tests/auto/qml/ecmascripttests/test262/test/language/expressions/super/call-spread-err-sngl-err-itr-get-get.js
raw symbols SCIP| 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/spread/sngl-err-itr-get-get.case |
| 3 | // - src/spread/error/super-call.template |
| 4 | /*--- |
| 5 | description: Spread operator applied to the only argument when GetIterator fails (@@iterator property access) (SuperCall) |
| 6 | esid: sec-super-keyword-runtime-semantics-evaluation |
| 7 | es6id: 12.3.5.1 |
| 8 | features: [Symbol.iterator] |
| 9 | flags: [generated] |
| 10 | info: | |
| 11 | SuperCall : super Arguments |
| 12 | |
| 13 | 1. Let newTarget be GetNewTarget(). |
| 14 | 2. If newTarget is undefined, throw a ReferenceError exception. |
| 15 | 3. Let func be GetSuperConstructor(). |
| 16 | 4. ReturnIfAbrupt(func). |
| 17 | 5. Let argList be ArgumentListEvaluation of Arguments. |
| 18 | [...] |
| 19 | |
| 20 | 12.3.6.1 Runtime Semantics: ArgumentListEvaluation |
| 21 | |
| 22 | ArgumentList : ... AssignmentExpression |
| 23 | |
| 24 | 1. Let list be an empty List. |
| 25 | 2. Let spreadRef be the result of evaluating AssignmentExpression. |
| 26 | 3. Let spreadObj be GetValue(spreadRef). |
| 27 | 4. Let iterator be GetIterator(spreadObj). |
| 28 | 5. ReturnIfAbrupt(iterator). |
| 29 | |
| 30 | 7.4.1 GetIterator ( obj, method ) |
| 31 | |
| 32 | 1. If method was not passed, then |
| 33 | a. Let method be ? GetMethod(obj, @@iterator). |
| 34 | ---*/ |
| 35 | var iter = {}; |
| 36 | Object.defineProperty(iter, Symbol.iterator, { |
| 37 | get: function() { |
| 38 | throw new Test262Error(); |
| 39 | } |
| 40 | }); |
| 41 | |
| 42 | class Test262ParentClass { |
| 43 | constructor() {} |
| 44 | } |
| 45 | |
| 46 | class Test262ChildClass extends Test262ParentClass { |
| 47 | constructor() { |
| 48 | super(...iter); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | assert.throws(Test262Error, function() { |
| 53 | new Test262ChildClass(); |
| 54 | }); |