summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/args-range-2.js
blob: 393d574df5aa7e7abdc39240034a886e1c165265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
actual = '';
expected = "undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,"; 

var index;

function h() {
  for (var i = 0; i < 5; ++i) {
    var a = arguments;
    appendToActual(a[index]);
  }
}

index = 0;
h();
index = -1;
h();
index = 1;
h();

index = -9999999;
h(1, 2, 3);
index = -1;
h(1, 2, 3);
index = 0;
h(1, 2, 3);
index = 1;
h(1, 2, 3);
index = 2;
h(1, 2, 3);
index = 3;
h(1, 2, 3);
index = 4;
h(1, 2, 3);
index = 9999999;
h(1, 2, 3);

assertEq(actual, expected)