| 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 |
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 |
6. Repeat |
| 30 |
a. Let next be IteratorStep(iterator). |
| 31 |
b. ReturnIfAbrupt(next). |
| 32 |
|
| 33 |
7.4.5 IteratorStep ( iterator ) |
| 34 |
|
| 35 |
1. Let result be IteratorNext(iterator). |
| 36 |
2. ReturnIfAbrupt(result). |
| 37 |
|
| 38 |
7.4.2 IteratorNext ( iterator, value ) |
| 39 |
|
| 40 |
1. If value was not passed, then |
| 41 |
a. Let result be Invoke(iterator, "next", « »). |
| 42 |
[...] |
| 43 |
3. ReturnIfAbrupt(result). |
| 44 |
---*/ |
| 45 |
var iter = {}; |
| 46 |
iter[Symbol.iterator] = function() { |
| 47 |
return { |
| 48 |
next: function() { |
| 49 |
throw new Test262Error(); |
| 50 |
} |
| 51 |
}; |
| 52 |
}; |
| 53 |
|
| 54 |
class Test262ParentClass { |
| 55 |
constructor() {} |
| 56 |
} |
| 57 |
|
| 58 |
class Test262ChildClass extends Test262ParentClass { |
| 59 |
constructor() { |
| 60 |
super(...iter); |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
assert.throws(Test262Error, function() { |
| 65 |
new Test262ChildClass(); |
| 66 |
}); |