Debugger: Difference between revisions

194 bytes added ,  14 January 2012
→‎Debugging hooks: Clarify interaction of onExceptionUnwind and 'finally' blocks.
(→‎Accessor Properties of the Debugger.Script Prototype Object: Remove Debugger.Script.prototype.live --- all scripts have GC-like lives now.)
(→‎Debugging hooks: Clarify interaction of onExceptionUnwind and 'finally' blocks.)
Line 153: Line 153:


<dt>onExceptionUnwind(<i>frame</i>, <i>value</i>)
<dt>onExceptionUnwind(<i>frame</i>, <i>value</i>)
<dd>The exception <i>value</i> has been thrown. Stack unwinding is underway. Some frames may already have been removed; <i>frame</i> is the most recent remaining stack frame. This method should return a [[#Resumption_Values|resumption value]] specifying how the debuggee's execution should proceed. If it returns <code>undefined</code>, stack unwinding continues as normal: if the current offset in <code>frame</code> is in a <code>try</code> block, control jumps to the corresponding <code>catch/finally</code> code; otherwise <i>frame</i> is discarded and stack unwinding continues. If the next older frame is also a debuggee script frame, the <code>onExceptionUnwind</code> hook will be called again for that frame.
<dd>The exception <i>value</i> has been thrown, and has propagated to <i>frame</i>; <i>frame</i> is the youngest remaining stack frame, and is a debuggee frame. This method should return a [[#Resumption_Values|resumption value]] specifying how the debuggee's execution should proceed. If it returns <code>undefined</code>, the exception continues to propagate as normal: if control in <code>frame</code> is in a <code>try</code> block, control jumps to the corresponding <code>catch</code> or <code>finally</code> block; otherwise, <i>frame</i> is popped, and the exception propagates to <i>frame</i>'s caller.
 
When an exception's propagation causes control to enter a <code>finally</code> block, the exception is temporarily set aside. When the <code>finally</code> block finishes, the exception resumes propagation, and the debugger's <code>onExceptionUnwind</code> handler is called again, in the same frame.


<dt>sourceHandler(<i>ASuffusionOfYellow</i>)
<dt>sourceHandler(<i>ASuffusionOfYellow</i>)
Confirmed users
497

edits