michael@0: // The Set constructor throws TypeError when passed a non-iterable argument. michael@0: michael@0: load(libdir + "asserts.js"); michael@0: michael@0: function argsobj() { return arguments; } michael@0: michael@0: var misc = [ michael@0: {}, {x: 1}, Math, isNaN, michael@0: Object.create(null), michael@0: argsobj(0, 1, 2), michael@0: null, michael@0: true, 0, 3.1416, michael@0: new Boolean(true), new Number(0), michael@0: {iterator: function () { return undefined; }}, michael@0: {iterator: function () { return null; }}, michael@0: {iterator: function () { return true; }}, michael@0: {iterator: function () { return 17; }}, michael@0: ]; michael@0: michael@0: for (var v of misc) { michael@0: assertThrowsInstanceOf(function () { Set(v); }, TypeError); michael@0: assertThrowsInstanceOf(function () { Map(v); }, TypeError); michael@0: }