exception-unwind-hook.js (477B)
1 // Test interaction between exception handler, debugger's onExceptionUnwind, 2 // and profiler's frame iterator. 3 4 var g = newGlobal({newCompartment: true}); 5 var dbg = new Debugger(g); 6 7 g.eval("" + function f() { 8 for (var i = 0; i < 120; i++) { 9 try { throw 1; } catch {} 10 } 11 }); 12 13 var count = 0; 14 dbg.onExceptionUnwind = function() { 15 enableGeckoProfiling(); 16 readGeckoProfilingStack(); 17 disableGeckoProfiling(); 18 count++; 19 }; 20 21 g.f(); 22 assertEq(count, 120);