blob: 5903b0df8d16c250bcfb4a29130ff9d7fa0f4d9a [file] [log] [blame]
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
// Test off-thread parsing.
load(libdir + 'asserts.js');
if (helperThreadCount() === 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');