summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Set-clear-4.js
blob: 5551a07abe2f38b97fe5b52896a8e53ad165a158 (plain)
1
2
3
4
5
6
7
8
9
10
// Clearing a Set after deleting some entries works.

var s = new Set(["a", "b", "c", "d"]);
for (var v of s)
    if (v !== "c")
        s.delete(v);
s.clear();
assertEq(s.size, 0);
assertEq(s.has("c"), false);
assertEq(s.has("d"), false);