Debian Codegraph @

js/src/jit-test/tests/collections/WeakMap-constructor-nonnull.js

raw
1 // WeakMap constructor should throw when key is nonnull.
2
3 load(libdir + "asserts.js");
4
5 var v1 = 42;
6
7 var primitive = 10;
8 assertThrowsInstanceOf(() => new WeakMap([[primitive, v1]]), TypeError);
9
10 var empty_array = [];
11 assertThrowsInstanceOf(() => new WeakMap([empty_array]), TypeError);