Debugger: Difference between revisions

Jump to navigation Jump to search
m
→‎Generator Frames: Tweak spacing.
(→‎Debug.Script: Initial text.)
m (→‎Generator Frames: Tweak spacing.)
Line 187: Line 187:
</dl>
</dl>


===Generator Frames===
=== Generator Frames ===


SpiderMonkey supports generator-iterator objects, which produce a series of values by repeatedly suspending the execution of a function or expression. For example, calling a function that uses <code>yield</code> produces a generator-iterator object, as does evaluating a generator expression like <code>(i*i for each (i in [1,2,3]))</code>.
SpiderMonkey supports generator-iterator objects, which produce a series of values by repeatedly suspending the execution of a function or expression. For example, calling a function that uses <code>yield</code> produces a generator-iterator object, as does evaluating a generator expression like <code>(i*i for each (i in [1,2,3]))</code>.
Line 194: Line 194:


When you use the <code>Debug</code> object to inspect a program that is running a generator frame, that frame appears on the stack like any other call frame, except that its <code>generator</code> property is <code>true</code>. Such a frame will disappear from the stack when it is suspended, and reappear (possibly with a different <code>older</code> frame and <code>depth</code> value) each time it is resumed.
When you use the <code>Debug</code> object to inspect a program that is running a generator frame, that frame appears on the stack like any other call frame, except that its <code>generator</code> property is <code>true</code>. Such a frame will disappear from the stack when it is suspended, and reappear (possibly with a different <code>older</code> frame and <code>depth</code> value) each time it is resumed.


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

edits

Navigation menu