Re: Setting breakpoints
James Ross <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
Adam Peller wrote:
> If I want to set a breakpoint on a given line of code in a file, I have to
> find the jsdIScript object which matches that line of code in a file and
> set
> the breakpoint there. Problem is, it's not a 1-1 mapping. When you have
> closures, you'll get overlapping jsdIScript objects. How do you know which
> one to set the breakpoint on? I guess you just have to determine which one
> is the inner-most object, or the smallest subset?
Actually, it's easier than that generally. The lines from the inner
scope will be executable in the inner script, and not the outer ones. To
take the most basic example:
/-- isLineExecutable in __topLevel__ script
| /-- isLineExecutable in function's script
v v
* var foo = 42;
* * function test() {
* var bar = foo * 4;
* return bar;
}
That's how Venkman does it, anyway (and with pretty print, the view is
only of a single script object anyway, so that's trivial).
--
James Ross <[email protected]>
ChatZilla Developer