diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/parallel/comprehension-throws.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/parallel/comprehension-throws.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,27 @@ +load(libdir + "asserts.js"); + +function buildComprehension() { + // Throws if elemental fun not callable + assertThrowsInstanceOf(function () { + var p = new ParallelArray([2,2], undefined); + }, TypeError); + assertThrowsInstanceOf(function () { + var p = new ParallelArray(2, /x/); + }, TypeError); + assertThrowsInstanceOf(function () { + var p = new ParallelArray(/x/, /x/); + }, TypeError); + assertThrowsInstanceOf(function () { + new ParallelArray([0xffffffff + 1], function() { return 0; }); + }, RangeError); + assertThrowsInstanceOf(function () { + new ParallelArray(0xffffffff + 1, function() { return 0; }); + }, RangeError); + assertThrowsInstanceOf(function () { + new ParallelArray([0xfffff, 0xffff], function() { return 0; }); + }, RangeError); +} + +// FIXME(bug 844887) throw correct exception +// if (getBuildConfiguration().parallelJS) +// buildComprehension();