Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // Iterator prototype surfaces.
3 load(libdir + "asserts.js");
4 load(libdir + "iteration.js");
6 function test(constructor) {
7 var proto = Object.getPrototypeOf(constructor()[std_iterator]());
8 var names = Object.getOwnPropertyNames(proto);
9 names.sort();
10 assertDeepEq(names, [std_iterator, 'next']);
12 var desc = Object.getOwnPropertyDescriptor(proto, 'next');
13 assertEq(desc.configurable, true);
14 assertEq(desc.enumerable, false);
15 assertEq(desc.writable, true);
17 assertEq(proto[std_iterator](), proto);
18 assertIteratorDone(proto, undefined);
19 }
21 //test(Array);
22 test(Map);
23 test(Set);