| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/spread/mult-expr.case |
| 3 |
// - src/spread/default/super-call.template |
| 4 |
/*--- |
| 5 |
description: Spread operator applied to AssignmentExpression following other elements (SuperCall) |
| 6 |
esid: sec-super-keyword-runtime-semantics-evaluation |
| 7 |
es6id: 12.3.5.1 |
| 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 |
5. Repeat |
| 28 |
a. Let next be IteratorStep(iterator). |
| 29 |
b. ReturnIfAbrupt(next). |
| 30 |
c. If next is false, return precedingArgs. |
| 31 |
---*/ |
| 32 |
var source = [3, 4, 5]; |
| 33 |
var target; |
| 34 |
|
| 35 |
var callCount = 0; |
| 36 |
|
| 37 |
class Test262ParentClass { |
| 38 |
constructor() { |
| 39 |
assert.sameValue(arguments.length, 5); |
| 40 |
assert.sameValue(arguments[0], 1); |
| 41 |
assert.sameValue(arguments[1], 2); |
| 42 |
assert.sameValue(arguments[2], 3); |
| 43 |
assert.sameValue(arguments[3], 4); |
| 44 |
assert.sameValue(arguments[4], 5); |
| 45 |
assert.sameValue(target, source); |
| 46 |
callCount += 1; |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
class Test262ChildClass extends Test262ParentClass { |
| 51 |
constructor() { |
| 52 |
super(1, 2, ...target = source); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
new Test262ChildClass(); |
| 57 |
assert.sameValue(callCount, 1); |