summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/slice-args-obj-03.js
blob: 32055802293e6f3a3978f33be1df9cf5a9ea34d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function escape() { with ({}) {} }

function foo(i) {
  return i;
}

function bar(n) {
  escape(arguments);
  var args = Array.prototype.slice.call(arguments);
  return foo(args[0]);
}

function baz(a, n) {
  return bar(n);
}

var sum = 0;
for (var i = 0; i < 10000; i++) {
  sum += baz(0, 1);
}
assertEq(sum, 10000);