onNewScript-off-main-thread-01.js (465B)
1 // |jit-test| skip-if: helperThreadCount() === 0 2 3 // We still get onNewScript notifications for code compiled off the main thread. 4 5 var g = newGlobal({newCompartment: true}); 6 var dbg = new Debugger(g); 7 8 var log; 9 dbg.onNewScript = function (s) { 10 log += 's'; 11 assertEq(s.source.text, '"t" + "wine"'); 12 } 13 14 log = ''; 15 g.offThreadCompileToStencil('"t" + "wine"'); 16 var stencil = g.finishOffThreadStencil(); 17 assertEq(g.evalStencil(stencil), 'twine'); 18 assertEq(log, 's');