summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/group-callback-evaluation.js
blob: 4fbb6467e7ad8f0099d35766c92c4b1bdb379c62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var array = [1, 2, 3];

var calls = 0;

var grouped = Object.groupBy(array, () => {
  calls++;

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

assertEq(calls, 3);

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