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 // A map iterator can cope with removing the next entry, then the current entry.
3 load(libdir + "asserts.js");
4 load(libdir + "iteration.js");
6 var map = Map([['a', 0], ['b', 1], ['c', 2], ['d', 3]]);
7 var iter = map[std_iterator]();
8 assertIteratorNext(iter, ['a', 0]);
9 assertIteratorNext(iter, ['b', 1]);
10 map.delete('c');
11 map.delete('b');
12 assertIteratorNext(iter, ['d', 3]);
13 assertIteratorDone(iter, undefined);