michael@0: // When a termination is propagated out of multiple frames, their onPop michael@0: // handlers are called in the correct order, and no onExceptionUnwind michael@0: // handlers are called. michael@0: var g = newGlobal(); michael@0: g.eval("function f() { terminate(); }"); michael@0: g.eval("function g() { f(); }"); michael@0: g.eval("function h() { g(); }"); michael@0: g.eval("function i() { h(); }"); michael@0: michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: var count = 0; michael@0: function makePopHandler(label, resumption) { michael@0: return function handlePop(completion) { michael@0: log += label; michael@0: assertEq(completion, null); michael@0: return resumption; michael@0: }; michael@0: } michael@0: dbg.onEnterFrame = function handleEnter(f) { michael@0: log += "(" + f.callee.name; michael@0: f.onPop = makePopHandler(f.callee.name + ")", michael@0: count++ == 0 ? { return: 'king' } : undefined); michael@0: }; michael@0: dbg.onExceptionUnwind = function handleExceptionUnwind(f, x) { michael@0: log += 'u'; michael@0: }; michael@0: log = ''; michael@0: assertEq(g.i(), 'king'); michael@0: assertEq(log, "(i(h(g(ff)g)h)i)");