summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/iterator-proto-2.js
blob: d6d5ba7d7f693e184d81a92bd1d664bb685f3c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Iterators of different collection types have different prototypes.

load(libdir + "iteration.js");

var aproto = Object.getPrototypeOf(Array()[Symbol.iterator]());
var mproto = Object.getPrototypeOf((new Map())[Symbol.iterator]());
var sproto = Object.getPrototypeOf((new Set())[Symbol.iterator]());
assertEq(aproto !== mproto, true);
assertEq(aproto !== sproto, true);
assertEq(mproto !== sproto, true);
assertEq(aproto.next !== mproto.next, true);
assertEq(aproto.next !== sproto.next, true);
assertEq(mproto.next !== sproto.next, true);