summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/some/short-circuit-on-true.js
blob: 4f0d67bf09f16678caef2e192fd255aa82b45f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally

const iter = [1, 2, 3].values();
const log = [];
const fn = (value) => {
  log.push(value.toString());
  return value % 2 == 0;
};

assertEq(iter.some(fn), true);
assertEq(log.join(','), '1,2');

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