summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-clear-iterators-2.js
blob: a64b5f11cb7d0ab070e1c90850c9fed2f9425e12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// A Map iterator continues to visit entries added after a clear().

load(libdir + "asserts.js");
load(libdir + "iteration.js");

var m = new Map([["a", 1]]);
var it = m[Symbol.iterator]();
assertIteratorNext(it, ["a", 1]);
m.clear();
m.set("b", 2);
assertIteratorNext(it, ["b", 2]);
assertIteratorDone(it, undefined);