The first Firebug feature I worked on was a whopper:
eval() debugging. One of the challenges is how to name the source code buffer.
By default Firefox names the
eval() buffer using the containing filename. This is a disaster: it’s the debugger equivalent of overstrike: eval functions overlap orginal functions.
Coming up with an alternative is not so easy. The name has to uniquely identify the buffer to support breakpoints and yet be understandable by developers. The Firebug default is to compute an MD5 hash for the buffer then show the developer a string related to the calling file and the source.
Firebug also supports developer-named
eval() buffers: just add a line to the end of your eval(expression) like:
This makes the source appear to come from the calling domain at file foo.js. The syntax of the line needs to match this regular expression: