summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Set-clear-iterators-3.js
blob: c814d4ca9ae5792e3832d764aba668c009c9c9a3 (plain)
1
2
3
4
5
6
7
8
9
10
// A closed Set iterator does not visit new entries added after a clear().

load(libdir + "iteration.js");

var s = new Set();
var it = s[Symbol.iterator]();
assertIteratorDone(it, undefined);  // close the iterator
s.clear();
s.add("a");
assertIteratorDone(it, undefined);