js/src/jit-test/tests/debug/onNewScript-off-main-thread.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/onNewScript-off-main-thread.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +// We still get onNewScript notifications for code compiled off the main thread.
     1.5 +
     1.6 +if (workerThreadCount() === 0)
     1.7 +  quit(0);
     1.8 +
     1.9 +var g = newGlobal();
    1.10 +var dbg = new Debugger(g);
    1.11 +
    1.12 +var log;
    1.13 +dbg.onNewScript = function (s) {
    1.14 +  log += 's';
    1.15 +  assertEq(s.source.text, '"t" + "wine"');
    1.16 +}
    1.17 +
    1.18 +log = '';
    1.19 +g.offThreadCompileScript('"t" + "wine"');
    1.20 +assertEq(g.runOffThreadScript(), 'twine');
    1.21 +assertEq(log, 's');

mercurial