|
The call stack is the chain of handler calls currently executing in your script. Execution typically starts with the script’s run handler (implicit or explicit). Code in this handler can call another handler, which can call another handler (or the same handler, recursively), and so on, so that at any given moment during the execution of your code, there is a nest or chain of handlers leading down from top level to the line currently being executed. The call stack is shown in the second pane of the result drawer (the word “Stack” appears at the top). ![]() The stack grows downward. In the illustration above, the script’s implicit run handler told the script object Stack frames newly added since the last time the script paused are shown in red. In the illustration above, all the stack frames are in red because this is the first pause since the script started executing. Reflecting the call stack back in the script’s text area is a little tricky, because as long as there are multiple stack frames, we can be paused at more than one place simultaneously. You can see this happening in this illustration: ![]() The implicit run handler of the main script (line 12) has called You can select a line of the call stack pane to explore different stack frames. When you do, three things will happen:
|
|||||||||||||||||