michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: // Test off-thread parsing. michael@0: michael@0: load(libdir + 'asserts.js'); michael@0: michael@0: if (workerThreadCount() === 0) michael@0: quit(0); michael@0: michael@0: offThreadCompileScript('Math.sin(Math.PI/2)'); michael@0: assertEq(runOffThreadScript(), 1); michael@0: michael@0: offThreadCompileScript('a string which cannot be reduced to the start symbol'); michael@0: assertThrowsInstanceOf(runOffThreadScript, SyntaxError); michael@0: michael@0: offThreadCompileScript('smerg;'); michael@0: assertThrowsInstanceOf(runOffThreadScript, ReferenceError); michael@0: michael@0: offThreadCompileScript('throw "blerg";'); michael@0: assertThrowsValue(runOffThreadScript, 'blerg');