summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-iterator-1.js
blob: 5e9d685737af4132aee5a9f5f91657f2e5263c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
// for-of can be used to iterate over a Map twice.

var map = new Map([['a', 0], ['b', 1], ['c', 2]]);
var log = '';

for (let i = 0; i < 2; i++) {
    for (let [k, v] of map)
        log += k + v;
    log += ';'
}
assertEq(log, 'a0b1c2;a0b1c2;');