javascript - Debugging JS/CoffeeScript code: Events, Callbacks etc -
recently finding difficulty understanding whats happening in coffeescript/backbone app. hard trace whats happening without slow step through. problem think is: know event triggered (backbone view event). dont know functions called because of it. there maybe more 1. may not know view partial event defined (so cant put breakpoint?)
is there debugger plots execution of program graph? can zoom need, or maybe can use "visualize" execution of code. maybe not, if should looking out for. not sure need put breakpoint since dont know events triggered. find hard understand why code step through might jumping here , there, maybe multiple events , handlers executing?
everything in backbone (views, models, collections, routers) extends backbone.events. means have _events property contains each bound event (e.g. change) array of subscribers.
in order access open javascript console in chrome, firefox or safari (or ie) , enter name of globally accessible instantiated object ._events @ end. e.g.
products._events after pressing enter should able expand , see published , subscribed.
Comments
Post a Comment