1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-onPop-10.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,22 @@ 1.4 +// Setting onPop handlers from an onStep handler works. 1.5 +var g = newGlobal(); 1.6 +var dbg = new Debugger(g); 1.7 +var log; 1.8 + 1.9 +dbg.onDebuggerStatement = function handleDebugger(frame) { 1.10 + log += 'd'; 1.11 + assertEq(frame.type, "eval"); 1.12 + frame.onStep = function handleStep() { 1.13 + log += 's'; 1.14 + this.onStep = undefined; 1.15 + this.onPop = function handlePop() { 1.16 + log += ')'; 1.17 + }; 1.18 + }; 1.19 +}; 1.20 + 1.21 +log = ""; 1.22 +g.flag = false; 1.23 +g.eval('debugger; flag = true'); 1.24 +assertEq(log, 'ds)'); 1.25 +assertEq(g.flag, true);