summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-constructor-1.js
blob: b1a55967dc8ad0f40276809f4b4c35badeb20009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// The Map constructor creates an empty Map by default.

load(libdir + "asserts.js");

var m = new Map();
assertEq(m.size, 0);
m = new Map(undefined);
assertEq(m.size, 0);
m = new Map(null);
assertEq(m.size, 0);

assertThrowsInstanceOf(() => Map(), TypeError);
assertThrowsInstanceOf(() => Map(undefined), TypeError);
assertThrowsInstanceOf(() => Map(null), TypeError);