1

I am working on a web application with most of the code written in javascript. This application is using backbone.js and It has all kinds of event listeners. Some view functions are listening to model change events, url change events or user interactions. It's really hard to tell how a specific function was called. Is there a way to get the entire trace of function calls that lead to current invocation?

2 Answers 2

6

Set a breakpoint at the start of the function in the debugger. When the breakpoint is hit, then examine the callstack in the debugger and you can see the function calls that led to this point.

Sign up to request clarification or add additional context in comments.

Comments

0

Firebug for Firefox will show the stack, once it stops in breakpoint you set.

Do you need the stack for debugging purposes?

Or, do you intend to use this information inside your code to make some kind of decision?

If that were the case, you could check the value of the variable "this".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.