Closed Bug 813087 Opened 9 years ago Closed 2 years ago

Debugger statement in Scratchpad


(DevTools Graveyard :: Scratchpad, enhancement, P3)



(Not tracked)



(Reporter: espadrine, Unassigned)




(1 file)

Steps to reproduce:

1. Open the Browser Debugger.
2. Open the Scratchpad.
3. Paste the following bit of code in there:
   (function foo(a, b) { var c = a + b; debugger; return c; }(1, 2));
4. Run it.

What I expected:
The Browser Debugger should show the contents of the Scratchpad.

What happens instead:
The Browser Debugger shows the following content for "Scratchpad/1": "Loading…"
It starts debugging. The stacks are displayed correctly. Yet, no JS is displayed.
This is because scratchpad uses evalInSandbox, passing a dummy Scratchpad/n filename and a line number of 1. We did this to make console.log and friends look intuitive to web developers who don't know about Firefox internals. Perhaps now the Browser Debugger provides a compelling argument for sending the correct source location, and maybe getting the web console to convert "scratchpad.js:330" to "Scratchpad:1" if we think it's important.
Component: Developer Tools: Debugger → Developer Tools: Scratchpad
Here is a patch to try out. Note that it breaks bug 661762 as it is.
Depends on: 637572
Priority: -- → P3
Duplicate of this bug: 898083
cc'ing Eddy. I think he mentioned taking a look at this during the work week.
Severity: normal → enhancement
Product: Firefox → DevTools

Scratchpad was removed in Bug 1519103 (Firefox 72). You can check the alternative in .

The Scratchpad bug list was reviewed and I think this bug can be safely closed.

Closed: 2 years ago
Resolution: --- → WONTFIX
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.