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

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

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

mercurial