michael@0: // collection.iterator() returns an Iterator object. michael@0: michael@0: load(libdir + "iteration.js"); michael@0: michael@0: function test(obj, name) { michael@0: var iter = obj[std_iterator](); michael@0: assertEq(typeof iter, "object"); michael@0: assertEq(iter instanceof Iterator, true); michael@0: assertEq(iter.toString(), "[object " + obj.constructor.name + " Iterator]"); michael@0: } michael@0: michael@0: test([]); michael@0: test(new Map); michael@0: test(new Set);