summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Set-iterator-remove-2.js
blob: e78d8a182f8d4bf9abd994b2c89f1105a4927e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// A map iterator can cope with removing the next entry.

load(libdir + "iteration.js");

var set = new Set("abcd");
var iter = set[Symbol.iterator]();
var log = "";
for (let x of iter) {
    log += x;
    if (x === "b")
        set.delete("c");
}
assertEq(log, "abd");