-1:000000000000 | 0:3fe31b92b5a8 |
---|---|
1 // collection.iterator() returns an Iterator object. | |
2 | |
3 load(libdir + "iteration.js"); | |
4 | |
5 function test(obj, name) { | |
6 var iter = obj[std_iterator](); | |
7 assertEq(typeof iter, "object"); | |
8 assertEq(iter instanceof Iterator, true); | |
9 assertEq(iter.toString(), "[object " + obj.constructor.name + " Iterator]"); | |
10 } | |
11 | |
12 test([]); | |
13 test(new Map); | |
14 test(new Set); |