Debian Codegraph @

js/src/jit-test/tests/collections/Set-constructor-1.js

raw
1 // The Set constructor creates an empty Set by default.
2
3 load(libdir + "asserts.js");
4
5 var s = new Set();
6 assertEq(s.size, 0);
7 s = new Set(undefined);
8 assertEq(s.size, 0);
9 s = new Set(null);
10 assertEq(s.size, 0);
11
12 assertThrowsInstanceOf(() => Set(), TypeError);
13 assertThrowsInstanceOf(() => Set(undefined), TypeError);
14 assertThrowsInstanceOf(() => Set(null), TypeError);