Debugger: Difference between revisions

1,340 bytes added ,  2 March 2011
Line 99: Line 99:
==Debug.Frame==
==Debug.Frame==


weak reference
A <code>Debug.Frame</code> instance represents a debuggee stack frame. It provides operations for finding the script the frame is executing, the frame that invoked it, and the lexical scope in which the execution is taking place.
 
A <code>Debug.Frame</code> instance is a weak reference to the frame; once the debuggee destroys the frame (perhaps by returning from the function or leaving an <code>eval</code> call), further operations on the <code>Debug.Frame</code> instance will raise an error.
 
Debugger code cannot construct <code>Debug.Frame</code> instances itself. SpiderMonkey creates them when calling hook functions, and <code>Debug.Frame.prototype.olderFrame</code> creates them as needed as the stack is traversed.
 
A <code>Debug.Frame</code> instance has the following properties, which are all read-only:
 
<dl>
<dt>type
<dd>A string describing what sort of frame this is:
<ul>
<li><code>"global"</code>
<li><code>"call"</code>
<li><code>"eval"</code>
<li><code>"host"</code>
<li><code>"debugger"</code>
</ul>
</dl>
 
<dt>older
<dt>depth
 
 
<dt>generator
<dt>callee
<dt>script
<dt>offset
<dt>scope
<dt>this
<dt>arguments
</dl>
 
A <code>Debug.Frame</code> instance has the following methods:
 
<dl>
<dt>olderFrame()
<dd>Return the frame that invoked this frame, or <code>null</code> if this is the oldest debuggee frame.
 
<dt>frame
 
 
generators


==Debug.Script==
==Debug.Script==
Confirmed users
497

edits