Confirmed users
497
edits
(→Debug.Frame: Clarify explanation of Debug.Frame.prototype.restart.) |
|||
| Line 176: | Line 176: | ||
<dt>restart(<i>function</i>, <i>this</i>, <i>arguments</i>) <i>(future plan)</i> | <dt>restart(<i>function</i>, <i>this</i>, <i>arguments</i>) <i>(future plan)</i> | ||
<dd>Pop any younger frames from the stack, and then | <dd>Pop any younger frames from the stack, and then change this frame into a frame for a call to <i>function</i>, with the given <i>this</i> value and <i>arguments</i>. <i>This</i> should be a debuggee value, or <code>{ asConstructor: true }</code> to invoke <i>function</i> as a constructor, in which case SpiderMonkey provides an appropriate <code>this</code> value itself. <i>Arguments</i> should be an array of debuggee values. This frame must be a <code>"call"</code> frame. | ||
This can be used as a primitive in implementing some forms of a "patch and continue" debugger feature. | |||
Note that this does <i>not</i> resume the debuggee's execution; it merely adjusts the debuggee's state to what it would be if this frame were about to make this call. You must return <code>true</code> from the hook function to resume execution in that state. | Note that this does <i>not</i> resume the debuggee's execution; it merely adjusts the debuggee's state to what it would be if this frame were about to make this call. You must return <code>true</code> from the hook function to resume execution in that state. | ||