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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/collections/Map-constructor-4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,6 @@
     1.4 +// Map(x) throws if x is not iterable (unless x is undefined).
     1.5 +
     1.6 +load(libdir + "asserts.js");
     1.7 +var nonIterables = [null, true, 1, -0, 3.14, NaN, {}, Math, this];
     1.8 +for (let k of nonIterables)
     1.9 +    assertThrowsInstanceOf(function () { Map(k); }, TypeError);

mercurial