michael@0: // Trying to set an onPop handler on a dead frame throws an exception. michael@0: var g = newGlobal(); michael@0: g.eval("function f() { }"); michael@0: g.eval("function g() { f(); }"); michael@0: g.eval("function h() { g(); }"); michael@0: g.eval("function i() { h(); }"); michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: michael@0: var frames = []; michael@0: dbg.onEnterFrame = function handleEnter(f) { michael@0: log += "("; michael@0: assertEq(f.live, true); michael@0: frames.push(f); michael@0: }; michael@0: log = ''; michael@0: g.i(); michael@0: assertEq(log, "(((("); michael@0: assertEq(frames.length, 4); michael@0: for (i = 0; i < frames.length; i++) { michael@0: assertEq(frames[i].live, false); michael@0: var set = false; michael@0: try { michael@0: frames[i].onPop = function unappreciated() { }; michael@0: set = true; // don't assert in a 'try' block michael@0: } catch (x) { michael@0: assertEq(x instanceof Error, true); michael@0: } michael@0: assertEq(set, false); michael@0: }