diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/basic/offThreadCompileScript-01.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/basic/offThreadCompileScript-01.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,21 @@ +// Any copyright is dedicated to the Public Domain. +// http://creativecommons.org/licenses/publicdomain/ + +// Test off-thread parsing. + +load(libdir + 'asserts.js'); + +if (workerThreadCount() === 0) + quit(0); + +offThreadCompileScript('Math.sin(Math.PI/2)'); +assertEq(runOffThreadScript(), 1); + +offThreadCompileScript('a string which cannot be reduced to the start symbol'); +assertThrowsInstanceOf(runOffThreadScript, SyntaxError); + +offThreadCompileScript('smerg;'); +assertThrowsInstanceOf(runOffThreadScript, ReferenceError); + +offThreadCompileScript('throw "blerg";'); +assertThrowsValue(runOffThreadScript, 'blerg');