michael@0: // Iterator prototype surfaces. michael@0: michael@0: load(libdir + "asserts.js"); michael@0: load(libdir + "iteration.js"); michael@0: michael@0: function test(constructor) { michael@0: var proto = Object.getPrototypeOf(constructor()[std_iterator]()); michael@0: var names = Object.getOwnPropertyNames(proto); michael@0: names.sort(); michael@0: assertDeepEq(names, [std_iterator, 'next']); michael@0: michael@0: var desc = Object.getOwnPropertyDescriptor(proto, 'next'); michael@0: assertEq(desc.configurable, true); michael@0: assertEq(desc.enumerable, false); michael@0: assertEq(desc.writable, true); michael@0: michael@0: assertEq(proto[std_iterator](), proto); michael@0: assertIteratorDone(proto, undefined); michael@0: } michael@0: michael@0: //test(Array); michael@0: test(Map); michael@0: test(Set);