summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/group-callback-evaluation.js
blob: 0a917df33da90eee3bfc610ee49bd631ba548ebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| shell-option(--enable-array-grouping) skip-if(!Array.prototype.group)

var array = [1, 2, 3];

var calls = 0;

var grouped = array.group(() => {
  calls++;

  return {
    toString() {
      return "a";
    }
  }
});

assertEq(calls, 3);

if (typeof reportCompare === "function")
  reportCompare(0, 0);