18.04.2016 Views

Professional JavaScript For Web Developers

javascript for learners.

javascript for learners.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Error Handling<br />

running any code. The Continue button resumes executing the script and continues until the natural end<br />

of the script or a breakpoint is encountered. The last three buttons are standard Step Over, Step Into, and<br />

Step Out commands.<br />

All these actions can also be performed in the Interactive view by using the commands in the following<br />

table.<br />

Debug Button<br />

Stop<br />

Continue<br />

Step Over<br />

Step Into<br />

Step Out<br />

Text Command<br />

/stop<br />

/cont<br />

/next<br />

/step<br />

/finish<br />

When code execution is stopped on a particular line, that line is highlighted in yellow in the Source<br />

Code view. Additionally, the function containing that line is displayed with a yellow arrow in the Call<br />

Stack view (Figure 14-21).<br />

Figure 14-21<br />

The Call Stack view always has a generic __toplevel__ item to represent the global scope from which<br />

the first function was called.<br />

Watches<br />

One of the unique features of Venkman is its capability to set up variable watches. Watches literally<br />

watch variables for changes in their values and display them in the Watches view.<br />

To add watches, you can select a variable in the Local Variables view, right-click, and select Add Watch<br />

Expression. You can also use the /watch-expr command in the Interactive view to do the same thing:<br />

/watch-expr variable_name<br />

441

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!