execution-observability-04.js (444B)
1 // Test that we can do debug mode OSR from the interrupt handler. 2 3 var global = this; 4 var hits = 0; 5 setInterruptCallback(function() { 6 print("Interrupt!"); 7 hits++; 8 var g = newGlobal({newCompartment: true}); 9 g.parent = global; 10 g.eval("var dbg = new Debugger(parent); dbg.onEnterFrame = function(frame) {};"); 11 return true; 12 }); 13 14 function f(x) { 15 if (x > 200) 16 return; 17 interruptIf(x == 100); 18 f(x + 1); 19 } 20 f(0); 21 assertEq(hits, 1);