5 ms·
Scala dev here who sometimes needs to do some JS (though haven't worked with ember). I feel your pain! Static typing and functional programming certainly make o
by CookWithMe 13y ago
Scala dev here who sometimes needs to do some JS (though haven't worked with ember). I feel your pain! Static typing and functional programming certainly make ones life easier once a project becomes bigger.
Anyway, for future reference, you may want to learn how to use the JS debugger (both Chrome and Firefox are quite good). You could have set a break/watchpoint on the variable 'foo'. Once it has changed, you can inspect the stack and would have found that the set('bar', ...) method was involved. Should be much quicker than printf-debugging...
- mightybyte 13y agoI use the debugger all the time. One problem is that when you're using Ember a lot of the call stack is cluttered with Ember internal calls, which obscures things. But even after I isolated the problem down to that line, the debugger still didn't help me fix the problem.
- CookWithMe 13y ago> a lot of the call stack is cluttered with Ember internal calls, which obscures things. Your debugger should be able to display the corresponding .js file for each line in the call stack. Jump down the stack until you find your code. Yes, it doesn't solve the problem (wanna talk about debugging freaking JSP or TinyMCE plugins? :p) but you won't > spent the better part of a day trying to track down the source of this problem.
- astrodust 13y agoThe Ember Chrome Extension (https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi?hl=en https://chrome.google.com/webstore/detail/ember-inspector/bm...) helps a lot.
- thatthatis 13y agoI seem to remember reading that chrome added the ability to "black box" libraries to remove them from the debugging call stack to help with situations just like this.
- iamstef 13y agoits still WIP, once they provide framework authors with what we need, rest assured ember will land it. We are actually working close with the firefox and chrome teams, to drastically improved general JavaScript developer ergonomics when debugging.