summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/args-mochi-2.js
blob: 4fec2dd9b04c9662ae66c1c640eb5d6c29b47cad (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,';

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

var f = function(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)