Debian Codegraph @

js/src/tests/test262/language/expressions/super/call-spread-mult-empty.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/spread/mult-empty.case
3 // - src/spread/default/super-call.template
4 /*---
5 description: Spread operator following other arguments when no iteration occurs (SuperCall)
6 esid: sec-super-keyword-runtime-semantics-evaluation
7 flags: [generated]
8 info: |
9 SuperCall : super Arguments
10
11 1. Let newTarget be GetNewTarget().
12 2. If newTarget is undefined, throw a ReferenceError exception.
13 3. Let func be GetSuperConstructor().
14 4. ReturnIfAbrupt(func).
15 5. Let argList be ArgumentListEvaluation of Arguments.
16 [...]
17
18 12.3.6.1 Runtime Semantics: ArgumentListEvaluation
19
20 ArgumentList : ArgumentList , ... AssignmentExpression
21
22 1. Let precedingArgs be the result of evaluating ArgumentList.
23 2. Let spreadRef be the result of evaluating AssignmentExpression.
24 3. Let iterator be GetIterator(GetValue(spreadRef) ).
25 4. ReturnIfAbrupt(iterator).
26 5. Repeat
27 a. Let next be IteratorStep(iterator).
28 b. ReturnIfAbrupt(next).
29 c. If next is false, return precedingArgs.
30 ---*/
31
32 var callCount = 0;
33
34 class Test262ParentClass {
35 constructor() {
36 assert.sameValue(arguments.length, 3);
37 assert.sameValue(arguments[0], 1);
38 assert.sameValue(arguments[1], 2);
39 assert.sameValue(arguments[2], 3);
40 callCount += 1;
41 }
42 }
43
44 class Test262ChildClass extends Test262ParentClass {
45 constructor() {
46 super(1, 2, 3, ...[]);
47 }
48 }
49
50 new Test262ChildClass();
51 assert.sameValue(callCount, 1);
52
53 reportCompare(0, 0);