summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-constructor-duplicates.js
blob: 125081bf87645566b93bf26a93ae57ab4dabebc8 (plain)
1
2
3
4
5
6
7
8
// When the argument to Map contains a key multiple times, the last value is retained.

var arg = [["zero", 7], ["one", 1], ["two", 4], ["zero", 8], ["two", 2], ["zero", 0]];
var m = new Map(arg);
assertEq(m.get("zero"), 0);
assertEq(m.get("one"), 1);
assertEq(m.get("two"), 2);
assertEq(m.size, 3);