js/src/jit-test/tests/basic/offThreadCompileScript-01.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:b7e84fa53dd8
1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
3
4 // Test off-thread parsing.
5
6 load(libdir + 'asserts.js');
7
8 if (workerThreadCount() === 0)
9 quit(0);
10
11 offThreadCompileScript('Math.sin(Math.PI/2)');
12 assertEq(runOffThreadScript(), 1);
13
14 offThreadCompileScript('a string which cannot be reduced to the start symbol');
15 assertThrowsInstanceOf(runOffThreadScript, SyntaxError);
16
17 offThreadCompileScript('smerg;');
18 assertThrowsInstanceOf(runOffThreadScript, ReferenceError);
19
20 offThreadCompileScript('throw "blerg";');
21 assertThrowsValue(runOffThreadScript, 'blerg');

mercurial