-
Notifications
You must be signed in to change notification settings - Fork 280
Description
It would be nice if the library could synchronously return the source-mapped stack-trace of a "raw" stack-trace.
The first time you request the source-mapped stack-trace, of course, it has to be asynchronous since the source files have not yet been retrieved using AJAX.
However, every time other than the first time, it should be possible to perform the process synchronously. To make this better, we could add some sort of "prepare" function, which would retrieve the source files ahead of time, letting the user then get all the source-mapped stack-traces synchronously from then on.
Why is this useful? One reason is for debugging. When you want to see "What call-stack led to this line of code being run?", currently there is no way to get the source-mapped version of that synchronously. This means you can't return it as a debug string, display it to the user in an execution-blocking alert, etc.
I've needed this behavior in multiple projects now -- enough now that I think I'm going to take an attempt at it myself. Will update here if I make any progress. (it shouldn't be that hard, since the only inherently asynchronous process seems to be the source-file text retrieval)