canjs / can-zone

A context for tracking asynchronous activity in JavaScript applications.
https://v4.canjs.com/doc/can-zone.html
MIT License
92 stars 4 forks source link

Make can-zone/debug's break: true break on entering async functions. #155

Closed matthewp closed 7 years ago

matthewp commented 7 years ago

Currently break: true breaks when the asynchronous callback is called. This has 1 main problem, you have to step into some can-zone code before you see your code. Depending on which task this could be just a tiny bit of stepping-into or it might be going into 2 or 3 functions.

Now I'm feeling like it might be better to break on when the asynchronous function is called. This would have the opposite problem; you'd start out in can-zone code and have to look in the call-stack to find the setTimeout or promise.then() code... but I still feel like this is a little bit easier; you just have to look at the callstack, not have to press some buttons in the right order.