-1:000000000000 | 0:62f1c930321f |
---|---|
1 // A map iterator can cope with removing the next entry, then the current entry. | |
2 | |
3 load(libdir + "asserts.js"); | |
4 load(libdir + "iteration.js"); | |
5 | |
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); |