diff options
Diffstat (limited to 'js/src/jit-test/tests/collections/Map-iterators-3.js')
-rw-r--r-- | js/src/jit-test/tests/collections/Map-iterators-3.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/collections/Map-iterators-3.js b/js/src/jit-test/tests/collections/Map-iterators-3.js new file mode 100644 index 000000000..d1aac03f8 --- /dev/null +++ b/js/src/jit-test/tests/collections/Map-iterators-3.js @@ -0,0 +1,10 @@ +// A closed Map iterator does not visit new entries added after a clear(). + +load(libdir + "iteration.js"); + +var m = new Map(); +var it = m[Symbol.iterator](); +assertIteratorDone(it, undefined); // close the iterator +m.clear(); +m.set("a", 1); +assertIteratorDone(it, undefined); // iterator still closed |