1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-onPop-09.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +// Setting onPop handlers from an onExceptionUnwind handler works. 1.5 +var g = newGlobal(); 1.6 +var dbg = new Debugger(g); 1.7 +var log; 1.8 + 1.9 +dbg.onExceptionUnwind = function handleUnwind(frame) { 1.10 + log += 'u'; 1.11 + assertEq(frame.type, "eval"); 1.12 + frame.onPop = function handleCallPop(c) { 1.13 + log += ')'; 1.14 + assertEq(c.throw, 'up'); 1.15 + }; 1.16 +}; 1.17 + 1.18 +log = ""; 1.19 +try { 1.20 + g.eval("throw 'up';"); 1.21 + log += '-'; 1.22 +} catch (x) { 1.23 + log += 'c'; 1.24 + assertEq(x, 'up'); 1.25 +} 1.26 +assertEq(log, 'u)c');