Debian Codegraph @

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

raw
1 // new WeakMap(x) throws if x is not iterable (unless x is undefined).
2
3 load(libdir + "asserts.js");
4 var nonIterables = [true, 1, -0, 3.14, NaN, {}, Math, this];
5 for (let k of nonIterables)
6 assertThrowsInstanceOf(function () { new WeakMap(k); }, TypeError);