summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/WeakMap-constructor-4.js
blob: 6b87d66f59d3cfc5f0cd260dd1acd9fcba97b708 (plain)
1
2
3
4
5
6
// new WeakMap(x) throws if x is not iterable (unless x is undefined).

load(libdir + "asserts.js");
var nonIterables = [true, 1, -0, 3.14, NaN, {}, Math, this];
for (let k of nonIterables)
    assertThrowsInstanceOf(function () { new WeakMap(k); }, TypeError);