blob: fd9f4988333a5cb695bfb1525529d97a085c60d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// A set iterator can cope with removing the next entry, then the current entry.
load(libdir + "iteration.js");
var set = new Set("abcd");
var iter = set[Symbol.iterator]();
assertIteratorNext(iter, "a");
assertIteratorNext(iter, "b");
set.delete("c");
set.delete("b");
assertIteratorNext(iter, "d");
assertIteratorDone(iter, undefined);
|