how to trace or debug javascript closures in firebug

邮差的信 提交于 2019-12-11 00:41:30

问题


How do i trace the values of local variables in closure, and also the execution flow of closures in firebug. or is there any other tools that is specifically for debugging closures.


回答1:


Yes. You can debug the javascript closure with Firebug. On Script tab, you can see all the object instances as well as the state of the whole object. Please, Find it below the screenshot of firebug showing local variables in closure.


(source: pengbos.com)

If you want to learn more read this here and practice it.




回答2:


In Google Chrome's Developer Tools you can inspect the closure stack by setting a breakpoint (in the Scope Variables section):

I would assume Firebug has similar functionality.




回答3:


You can see Closure Inspector of Firebug.



来源:https://stackoverflow.com/questions/8921291/how-to-trace-or-debug-javascript-closures-in-firebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!