summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/args-mochi-2a.js
blob: 5c8895b15a2f3d29971663ed720a8fee468f7380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
actual = '';
expected = 'true,';

function isNotEmpty(args, i) {
  var o = args[i];
  if (!(o && o.length)) {
    return false;
  }
  return true;
};

function f(obj) {
  for (var i = 0; i < arguments.length; i++) {
    if (!isNotEmpty(arguments, i))
      return false;
  }
  return true;
}

appendToActual(f([1], [1], [1], "asdf", [1]));


assertEq(actual, expected)