Created attachment 639612 [details]
tested with latest Aurora (Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120705 Firefox/15.0a2) and latest nightly (Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/16.0 Firefox/16.0)
Steps to reproduce:
1. Open the attached file
2. Open the debugger
3. Set a breakpoint on the 10th line (document.getElementById("demo").innerHTML=x;)
4. Click Run
5. The execution stops at the breakpoint
6. Click resume button once
Nothing happens, except that it seems to reload something at the "Global Scope [Window]".
Note that if you click one more time at the resume button the execution goes on normally.
What should happen:
It should have the same behavior as when the script is in an external file. So it should go on after the breakpoint with only one click.
Note that the same behavior exists on step in/over/out.
This was introduced with the patch for bug 737808. We add stored breakpoints for new scripts, without making sure that the lines in the stored breakpoints exist in those scripts.
Created attachment 640213 [details] [diff] [review]
The two-line fix and a test. Nice catch fredy!
Comment on attachment 640213 [details] [diff] [review]
I've noticed this bug!
r+ with a try run!
Try run: https://tbpl.mozilla.org/?tree=Try&rev=dcd2eb6ec16c
Created attachment 641546 [details] [diff] [review]
Working patch v2
The test produced a couple of oranges, so I simplified it a bit to avoid them. New try: https://tbpl.mozilla.org/?tree=Try&rev=5e5915c9afa6
Created attachment 641581 [details] [diff] [review]
Working patch v3
OK, so I got oranges again. Sue me. But this time I found a way to test the fix without depending on the test page being updated at all. Final try (famous last words): https://tbpl.mozilla.org/?tree=Try&rev=6ada79c9b665
I told ya it would work!
The test added in the landing above, leaked on it's first run:
TEST-UNEXPECTED-FAIL | browser/devtools/debugger/test/browser_dbg_breakpoint-new-script.js | leaked 2 window(s) until shutdown [url = http://example.com/browser/browser/devtools/debugger/test/browser_dbg_breakpoint-new-script.html]
Verified fixed on the latest Aurora and Nightly