diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/onNewScript-off-main-thread.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/onNewScript-off-main-thread.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,18 @@ +// We still get onNewScript notifications for code compiled off the main thread. + +if (workerThreadCount() === 0) + quit(0); + +var g = newGlobal(); +var dbg = new Debugger(g); + +var log; +dbg.onNewScript = function (s) { + log += 's'; + assertEq(s.source.text, '"t" + "wine"'); +} + +log = ''; +g.offThreadCompileScript('"t" + "wine"'); +assertEq(g.runOffThreadScript(), 'twine'); +assertEq(log, 's');